Skip to content

Android: campaign 'Not received' and resend, native - #64

Merged
Axoineo merged 1 commit into
mainfrom
feat/android-native-4
Nov 19, 2026
Merged

Axoineo merged 1 commit into
mainfrom
feat/android-native-4

Conversation

@Axoineo

@Axoineo Axoineo commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

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 analyze clean; 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

  • Not run on the emulator or a real phone; the resend was tested against a stand-in server only, no real messages.

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T12:23:34.334375Z 36ba6ab PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying dikho with  Cloudflare Pages  Cloudflare Pages

Latest commit: 36ba6ab
Status: ✅  Deploy successful!
Preview URL: https://505b862b.dikho.pages.dev
Branch Preview URL: https://feat-android-native-4.dikho.pages.dev

View logs

@Axoineo
Axoineo merged commit 6b68510 into main Nov 19, 2026
9 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

subtitle: '${_count(t.failed)} failed and ${_count(d.notSent)} never sent',

P2 Badge Avoid counting failed sends twice

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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant