Commit 7c3a324
Fix stale state and formatting in sync dialog (#2299)
* Refresh SyncDialog state on background sync events
* Dedupe concurrent refreshStatus calls
* Fix empty render when diff < smallestUnit in formatRelativeDate
Intl.DurationFormat hides zero-valued fields by default, so an absDiffMs
below the smallest requested unit (e.g. <1s for seconds) was emitting an
empty string and the "Last sync: " label briefly showed nothing right
after a fresh sync. Fall back to a forced-display zero so Intl handles
plurals correctly across styles and locales.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Silence Blazor WebView 'no pending async call' toast
Benign race during page refresh: .NET completes a JS->.NET call whose
JS-side registry was already torn down. Add to the existing ignore-list.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Fix sticky 'Last sync: Never' after fast close→reopen
The 500ms onClose timer wiped state to undefined; combined with the
refreshStatus dedupe (a784c90) it permanently stranded the dialog
without data when the user reopened during the close-animation window.
Removing onClose: data persists in memory while the dialog is closed
(bits-ui keeps content mounted but hidden), so the next open shows the
previous values until refreshStatus overwrites them.
Also moved the projectEventBus.onSync subscription below the
pendingRefresh declaration: onSync invokes its callback synchronously
with a cached event, which can reach refreshStatus and hit the TDZ.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* Refetch SyncDialog state when a sync arrives during in-flight refresh
The pendingRefresh dedupe returned the same promise to all overlapping
callers, including onSync handlers triggered by another client's push.
That meant the in-flight refresh (started before the push landed) would
resolve with pre-sync data and no follow-up would fire.
Mark refreshStatus calls from the onSync handler as forceFresh so they
queue a rerun after the in-flight refresh finishes. Other overlapping
calls (cached-event-on-subscribe, post-syncLexboxToLocal) still dedupe,
preserving the original round-trip savings in those flows.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6305062 commit 7c3a324
4 files changed
Lines changed: 84 additions & 17 deletions
File tree
- frontend/viewer/src
- lib
- components/ui/format
- errors
- project
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
50 | | - | |
51 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
52 | 73 | | |
53 | 74 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
| |||
107 | 129 | | |
108 | 130 | | |
109 | 131 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 132 | + | |
115 | 133 | | |
116 | 134 | | |
117 | 135 | | |
| |||
0 commit comments