Repository navigation
Android: campaign 'Not received' and resend, native - #64
Conversation
The last screen that opened a web page: who a WhatsApp campaign did not reach (failed or never attempted, with the reason) and Send again, asked first, in batches until nobody is left, stopping when Meta reports a problem, as CampaignUnsent.jsx. A campaign from before audiences were recorded can be checked against every contact on request. The web-page callback is gone from the campaign screens, the dashboard and the wizard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Deploying dikho with
|
| Latest commit: |
36ba6ab
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://505b862b.dikho.pages.dev |
| Branch Preview URL: | https://feat-android-native-4.dikho.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
campaignPerformance sets notSent to total_count - sent, which already counts failed rows. A campaign with 10 failed recipients and no never-attempted recipients therefore shows “10 failed and 10 never sent” here; use a breakdown that excludes failed recipients or the unsent list endpoint’s counts so the campaign totals are not doubled.
AGENTS.md reference: AGENTS.md:L106-L106
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (mounted) { | ||
| setState(() { | ||
| _list = UnsentList(data); | ||
| _error = null; |
There was a problem hiding this comment.
Keep resend errors visible after refreshing the list
When a retry returns halted or throws an ApiException, _resend stores the message in _error, then its finally reloads the list; this success path clears _error here. The Meta halt or retry failure therefore disappears as soon as the refresh succeeds, leaving the operator unaware that sending stopped or failed. Keep the retry outcome separate from the load error, or avoid clearing it during the post-send refresh.
AGENTS.md reference: AGENTS.md:L150-L150
Useful? React with 👍 / 👎.
| final data = await widget.api.get('/campaigns/${widget.campaignId}/unsent', query: _everyone ? {'includeUnrecorded': '1'} : null); | ||
| if (mounted) { | ||
| setState(() { | ||
| _list = UnsentList(data); |
There was a problem hiding this comment.
Ignore stale unsent-list responses before enabling resends
If a refresh (including the post-resend reload) is still in flight when someone taps “Check all contacts,” the older request can finish last and overwrite the full-contact result here while _everyone remains true and hides the unaccounted warning. The resend then posts includeUnrecorded: true, so the API can send paid messages to recipients absent from the displayed list and confirmation count. Ignore stale responses or bind each result to the mode used for its request.
AGENTS.md reference: AGENTS.md:L106-L107
Useful? React with 👍 / 👎.
| child: Padding( | ||
| padding: const EdgeInsets.fromLTRB(Gap.l, Gap.s, Gap.l, Gap.m), | ||
| child: FilledButton.icon( | ||
| onPressed: progress != null || widget.sending ? null : () => unawaited(_resend()), |
There was a problem hiding this comment.
Refresh campaign status before keeping resends disabled
widget.sending is a one-time snapshot from the campaign details, and pull-to-refresh here reloads only /unsent. If the campaign finishes while this screen remains open, this condition stays true and staff cannot resend its remaining failures until they leave, refresh the parent campaign, and reopen this screen. Refresh or poll campaign status along with the unsent list.
AGENTS.md reference: AGENTS.md:L11-L12
Useful? React with 👍 / 👎.
| padding: const EdgeInsets.all(Gap.xl), | ||
| child: Column( | ||
| children: [ | ||
| Text('Everyone has been sent to', style: theme.textTheme.titleMedium), |
There was a problem hiding this comment.
Avoid claiming completion when no recipients are retryable
An empty /unsent list does not always mean everyone has been sent to: the endpoint excludes pending message rows, so this state can occur while a campaign is still sending. In that case the screen claims completion and omits its “still sending” notice. Show that there are no currently retryable recipients while preserving the campaign’s in-progress status.
AGENTS.md reference: AGENTS.md:L106-L107
Useful? React with 👍 / 👎.
The last app screen that opened a web page: who a WhatsApp campaign did not reach (failed or never attempted, with the reason), and Send again, asked first (each message is paid), in batches until nobody is left, stopping when Meta reports a problem. Same API and rules as
CampaignUnsent.jsx. One website change:public/.well-known/assetlinks.json, the production key's public fingerprint, so Gmail's sign-in return opens the app on Android 12+. Public by design.After this, no screen in the app opens a web page.
Checked
flutter analyzeclean; campaigns and dashboard tests 27 of 27, including: the list with reasons, the confirmation, two resend batches (the second sends exactly the ids the first handed back), the list refreshing to empty, and no resend without permission.Not checked
🤖 Generated with Claude Code