Repository navigation
Android app: native screens for the whole CRM, plus web and API support - #59
Conversation
…API support Saved from local work so it is not lost; not yet reviewed as a PR. Android app (dikho-mobile): native sign-in owning the session, Clients, Leads, Sales and Purchase orders, Vendors, Users, Settings, Live Assist on phones, the WhatsApp inbox, dashboard, campaigns, contacts and templates, Phone contacts, and the whole Email Hub (inbox, overview, analytics, campaigns, templates, consent, Email settings with Google's return finished in the app). Every drawer entry is now a native screen. Web and API: page handoffs to native screens, the shell bridge, WhatsApp analytics, campaign send request ids, contact import, the tax invoice page, Live Assist picture frames. D1 migration 0013 is NOT applied. Docs: ADRs 0012 to 0014, ANDROID.md, the v1.1 task log, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved: - Contact import (lib, review screen, tests): main's finished version. - Campaign wizard: main's file-first wizard, plus this branch's request id on the first Send so a retried send stays one campaign. - Campaigns API: this branch's request id handling, and send-batch taking the template from the campaign row rather than the request. - WhatsApp Contacts: this branch's paging as you scroll (main has none). - CHANGELOG and TESTING: both sides' entries, repeats removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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: |
b34bafc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://075eed0d.dikho.pages.dev |
| Branch Preview URL: | https://feat-android-app.dikho.pages.dev |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5eb58b5743
ℹ️ 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".
|
|
||
| const prepared = await prepareTemplate(c, choice) | ||
| if (prepared.refusal) return prepared.refusal | ||
| if (existing && await sentTemplateRecently(db, existing.id, choice.name)) { |
There was a problem hiding this comment.
Claim direct sends before calling Meta
If two staff send the same template to a new phone before either Meta call returns, both requests can find no existing conversation, so this duplicate check is skipped. The conversation is created only after Meta accepts a send, allowing both calls to send and bill the number despite the two-minute duplicate check. Add an atomic per-phone/template claim before sending.
AGENTS.md reference: src/api/AGENTS.md:L33-L33
Useful? React with 👍 / 👎.
| const earlier = campaign ? null : await c.env.DB.prepare('SELECT id FROM campaigns WHERE request_id = ?').bind(requestId).first() | ||
| const campaignId = campaign?.id ?? earlier?.id |
There was a problem hiding this comment.
Honor recorded halts on initial-send retries
When the first /send batch hits a campaign-wide Meta halt and the response is lost, postWithRetry replays the same requestId; this branch reuses the campaign but falls through to claimRecipients without checking recordedHalt(). finishBatch() deleted claims for recipients not attempted before the halt, so the replay can reclaim them and issue more messages even though the halt says to stop (e.g. 131048). Return the stored halted response or check the recorded halt before sending a retried initial batch.
AGENTS.md reference: src/api/AGENTS.md:L33-L33
Useful? React with 👍 / 👎.
What this is
The Android app's v1.1 work, saved from local and brought up to date with
main:dikho-mobile): native sign-in that owns the session (ADR 0013), Clients, Leads, Sales and Purchase orders, Vendors, Users, Settings, Live Assist on phones (ADR 0014), the WhatsApp inbox, dashboard, campaigns, contacts and templates, Phone contacts, and the whole Email Hub (overview, inbox, analytics, campaigns, templates, consent, Email settings). Every drawer entry is now a native screen. Google's mailbox connection opens in the phone's browser and its return is finished by the app.send-batchtakes the template from the campaign row, WhatsApp analytics with a daily cache, inbox paging for the app.The merge with
mainis described in its commit message (main's contact import and file-first wizard kept; this branch's request id, paging and send-batch rule kept).Must happen in this order
0013_android_inbox.sqlon the remote database (owner runs it). The API reads its tables.npm run deploy:api).public/.well-known/assetlinks.jsonneeds its fingerprint for the Gmail return to open the app on Android 12+.Checked
npm run checkafter the merge: lint, 343 tests, build, secret scan, all passing.flutter analyzeclean, 392 tests passing (main changed nothing underdikho-mobile).email10 of 10,settings6 of 6, earlierassist7 of 7,signin6 of 6,orders6 of 6.Not checked
native,web,files,layout,walk,upgrade) still open web pages from the drawer, which no longer has any; they need rewriting when the WebView is removed.🤖 Generated with Claude Code