Skip to content

Harden widget toast state + SDK error-status edge #5

Description

@hynding

From Sprint 0-1 reviews (widgets/sdk task review Minors + final review triage #7/#8), bundled as one hardening pass:

Widgets (packages/widgets):

  • UnlockToast removal uses reference equality (x !== u) and key ${achievementId}-${unlockedAt} — same-millisecond or reused-payload unlocks can collide/remove prematurely
  • BadgeCabinet keeps a stale list if a refetch-on-unlock fails (decide: keep-stale vs clear)
  • vi.useRealTimers() in the test isn't in try/finally — fake timers can leak if an assertion throws

SDK (packages/sdk):

  • On mixed failures (5xx then network error), the thrown PromoceanApiError carries the stale earlier 5xx status
  • The exhausted-retries test asserts a message substring rather than instanceof PromoceanApiError + .status

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions