Commit fdb51b9
fix(api): coalesce concurrent isS3Enabled probes
Two related bugs in the previous boolean-only cache:
1. Stampede: `isS3Enabled()` was called from every `DrawingCard` that
mounts. With several cards mounting in the same render pass, each
call hit the cache as `null`, fired its own GET /files/config, and
raced. Now we cache the in-flight Promise so concurrent callers
coalesce onto a single request.
2. Sticky-false on transient failures: a 401 during the auth-status
bootstrap or a one-off network blip permanently latched the cache
to `false`, disabling S3 uploads for the rest of the page lifetime
even after auth recovered. Only a successful response is cached
now; failures resolve `false` for that caller but leave the cache
open for retry.
Change-Id: Ib38aae45e2724057f12b9a8d03a3603381ecef6a
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 98e407e commit fdb51b9
1 file changed
Lines changed: 29 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
| 689 | + | |
690 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
691 | 698 | | |
692 | 699 | | |
693 | 700 | | |
694 | | - | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
695 | 704 | | |
696 | 705 | | |
697 | 706 | | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
705 | 725 | | |
706 | 726 | | |
707 | 727 | | |
| |||
0 commit comments