fix(points): ensure sagas are spawned on statsig refresh
Description
Test plan
n/a
Related issues
n/a
Backwards compatibility
n/a
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will:
- [x] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)
Codecov Report
Attention: Patch coverage is 73.91304% with 12 lines in your changes missing coverage. Please review.
Project coverage is 86.48%. Comparing base (
e5e2b3f) to head (1b8c56c). Report is 1 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5617 +/- ##
==========================================
- Coverage 86.49% 86.48% -0.01%
==========================================
Files 772 774 +2
Lines 31671 31702 +31
Branches 5466 5177 -289
==========================================
+ Hits 27394 27419 +25
- Misses 4043 4238 +195
+ Partials 234 45 -189
| Files | Coverage Δ | |
|---|---|---|
| src/points/PointsDiscoverCard.tsx | 100.00% <100.00%> (ø) |
|
| src/points/saga.ts | 85.16% <70.00%> (-2.52%) |
:arrow_down: |
... and 90 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update e5e2b3f...1b8c56c. Read the comment docs.
should this fix the issue Jean complained about?
should this fix the issue Jean complained about?
yes i think so!
now the sagas are spawned no matter what the statsig value is, but despite we are waiting until the address exists it is not enough time and we have to wait (or listen) to when the statsig will finish its update
I've put some console.logs:
[13:51:04.623Z] [90miPhone 15[39m --- WAITING FOR ADDRESS TO EXIST
[13:51:25.493Z] [90miPhone 15[39m --- ADDRESS EXISTS
[13:51:25.495Z] [90miPhone 15[39m --- GETTING POINTS CONFIG {"showPoints": false}
notice it tries to get statsig config immediately after it gets an address. i guess it is too early. we have to wait for statsig to react to address update. i wonder if we have any way to handle it.
or maybe we should watch some event other than APP_INIT to spawn initial sagas getting config and balance
TY for the ideas @bakoushin ! i clearly didn't test properly before 😅 i also was thinking about triggering the sagas on a different event because the coordination of statsig and account initialisation was feeling too hard....