Repository navigation
fix(emoji): bound the legacy custom-emoji union and keep the last good mobile palette - #8792
blakemcanally wants to merge 1 commit into
Conversation
Codex Review SummaryThis 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. |
🔐 Codex Security Review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55d1fc9d35
ℹ️ 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".
…d mobile palette Desktop: name the 500-set fetch limit, cap the union at 4000 entries with a deterministic shortcode-order subset, warn and report when the set limit is reached or entries are dropped, and expose the report and refresh-failure state through useCustomEmojiCatalogStatus. The status hook reports any failed fetch, including a failed first load, so a cold-start timeout no longer shows as an empty healthy catalog. The report query is never garbage-collected, and the notice text is a tested pure function. Mobile: a failed palette fetch keeps the last good palette, raises a refresh failure flag, and the picker shows a Retry banner. Switching relay drops the retained palette and the refresh-failed flag so one community's palette never shows in another. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: bmcanally <bmcanally@squareup.com>
joahg
left a comment
There was a problem hiding this comment.
🤖 Read the desktop cap/status changes and the mobile last-good palette logic; the community-switch finding is fixed. GitHub reports the branch as conflicting with base, so it needs a rebase before merge.
| _lastGood = null; | ||
| _lastGoodRelayUrl = relayUrl; | ||
| if (switched) { | ||
| state = const AsyncData([]); |
There was a problem hiding this comment.
🤖 Assigning state inside build() and deferring the flag reset with Future.microtask is easy to get wrong. If the switch test is flaky or the flag lags a frame, resetting both in one place would be safer.
22c6af3 to
f369882
Compare
Summary
This change adds guards to the legacy custom-emoji union.
It does not add the new kind 30180.
Desktop now bounds the union and reports when it drops data.
Desktop keeps the last good catalog when a refresh fails.
Mobile now keeps the last good palette when a fetch fails.
The mobile picker shows a Retry control after a failure.
Design
Desktop:
COMMUNITY_EMOJI_SET_LIMIT(500) names the set limit. The fetch uses it.console.warn. It also setssetLimitReachedin the catalog report.COMMUNITY_EMOJI_ENTRY_CAPis 4000 entries.localStorageQuota.tskeeps pure caches under 2 MiB. 1.3 MB fits with margin.droppedEntriesand callsconsole.warn.useCustomEmojiCatalogStatus()returnsrefreshFailed,setLimitReached, anddroppedEntries. The settings card shows a short status note.refreshFailedfor any failed fetch, including a failed first load, andhasCatalogtells the UI whether an older list still shows. The code never turns a failure into an empty list.gcTime: Infinity, so the notice survives the 20-minute poll.customEmojiCatalogNotice.resetCommunityState()needs no change.crates/buzz-relay/src/config.rs) can never reach the client. The PR adds no code for that case.Mobile:
CustomEmojiPaletteNotifierkeeps the last good palette.customEmojiRefreshFailedProvider.refresh()no longer clears the palette to a loading state._CustomEmojiRetryBannerabove the grid. The Retry button takes its only label from its own text.Testing
Desktop (all pass):
pnpm -C desktop install --frozen-lockfilepnpm -C desktop test(6918 node tests, 171 jsdom tests)pnpm -C desktop typecheckpnpm -C desktop check(3 existing warnings in other files)just file-size-checkNew desktop tests:
customEmoji.test.mjs(cap, order, warn, limit flag) andcatalogRefresh.test.mjs(failed refresh keeps data, report is published, failed first load is flagged, report is never garbage-collected, notice text for every branch). They call the productionqueryFnwith a stubbedrelayClient.fetchEvents.Mutation checks on desktop (each break made a test fail, then I restored the code):
console.warnremoved: 2 tests failed.hasCatalog: 1 test failed.Interop evidence: not applicable. This change adds no wire format. The union reads the same kind 30030 events as before.
Mobile: ran on a macOS laptop after the Blox run, because the workstation cannot reach pub.dev.
just mobile-install mobile-check mobile-test: all pass.savedPrefsProvider. The first-load case also usedpumpAndSettle, so Riverpod's automatic provider retry (relayProviderRetry) used the scripted success before the test checked the banner. Commit 55d1fc9 fixes the test. The product code did not change.hasErrorguard inemoji_picker.dartremoved, the first-load test fails.--no-verify, because without resolved packages the pre-commit Dart formatter rewrote about 250 unrelated files. The fix commit ran the hooks, andmobile-fmtpasses.Manual test steps
Desktop:
. ./bin/activate-hermit && pnpm -C desktop test. Success: 0 failures.just desktop-dev. Open Settings, then Custom emoji. Success: the community list shows. No status note shows.Mobile (needs network):
just mobile-install mobile-check mobile-test. Success: all pass, including the new journey test.just mobile-dev. Open the emoji picker. Turn on airplane mode. Trigger a refresh (switch community, or reconnect).🤖 Generated with Claude Code