Commit 7eec766
fix(blabsy): treat Blab creation as canonical send, counters best-effort
Addresses review feedback: addDoc and the counter updates ran together in
Promise.all, so if addDoc succeeded but manageTotalTweets/manageTotalPhotos
rejected, the catch reported "Failed to send" even though the Blab was
created — prompting a retry and duplicate Blabs while metrics drift.
Await addDoc on its own as the canonical send, then run the counter/reply
updates best-effort (logged, non-fatal). Also use tweetRef.id directly
instead of an extra getDoc round-trip, removing another post-send failure
point (and a read).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 8d402b7 commit 7eec766
1 file changed
Lines changed: 12 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
| |||
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
120 | | - | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
0 commit comments