You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## **Description**
Use new sids prop from ois reward data service call. This allows us to
enrich the reward controller cache more efficiently and avoid things
like:
- Out of sync cache with reality, having to do an explicit performauth
to get the subscription id.
## **Changelog**
CHANGELOG entry: null
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Leverages `sids` from `getOptInStatus` to cache per-account
subscription IDs and use them for candidate selection, updating DTOs,
controller logic, and tests.
>
> - **RewardsController**:
> - Add `sids` support to `OptInStatusDto`; when feature disabled,
return `{ ois: [false], sids: [null] }`-shaped responses.
> - Enhance `getOptInStatus` to merge cached/fresh results, cache
`hasOptedIn` and `subscriptionId` from `sids`, and return `{ ois, sids
}`.
> - Update `getCandidateSubscriptionId` to return the first available
subscription from `sids` before attempting silent auth.
> - Persist cached subscription IDs in account state; use cached values
when present.
> - **Types**:
> - Extend `OptInStatusDto` with `sids: (string | null)[]`.
> - **Tests**:
> - Update controller, data-service, and hook tests to include/validate
`sids` handling.
> - Add cases for caching behavior, mixed cached/fresh results, and
using `sids` for candidate subscription resolution.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
63a891c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Alexandre Chappaz <[email protected]>
0 commit comments