-
Notifications
You must be signed in to change notification settings - Fork 25
fix(core): harden session, settings, and realtime lifecycle races #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,12 +131,14 @@ private void EnsureLoaded() | |
| mentionPolicy = me.MentionPolicy; | ||
| tagPolicy = me.TagPolicy; | ||
| requireTagApproval = me.RequireTagApproval; | ||
| loaded = true; | ||
| } | ||
|
|
||
| loaded = true; | ||
| } | ||
| catch (Exception exception) | ||
| { | ||
| AepLog.Warning($"Tag privacy load failed: {exception.Message}"); | ||
| loaded = true; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Blocking: same shape as PrivacyPage. After a failed load the page shows default policies as real values, and |
||
| } | ||
| finally | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,7 +101,7 @@ public void VerifyLodestone() | |
| if (result.Auth is { } auth) | ||
| { | ||
| session.SignIn(auth.Token, auth.User); | ||
| signedIn?.Invoke(); | ||
| _ = Plugin.Framework.RunOnFrameworkThread(() => signedIn?.Invoke()); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||
| Reset(); | ||
| return; | ||
| } | ||
|
|
@@ -188,7 +188,7 @@ private async Task PollXivLoopAsync(string flowId, int intervalSeconds, int expi | |
| if (result.Auth is { } auth) | ||
| { | ||
| session.SignIn(auth.Token, auth.User); | ||
| signedIn?.Invoke(); | ||
| _ = Plugin.Framework.RunOnFrameworkThread(() => signedIn?.Invoke()); | ||
| Reset(); | ||
| return; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,5 @@ public void Run( | |
| public void Dispose() | ||
| { | ||
| cancellation.Cancel(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: dropping |
||
| cancellation.Dispose(); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,13 +44,15 @@ public bool EnsureStartedLocked(Guid callId, int localSlot) | |
| return false; | ||
| } | ||
|
|
||
| if (localSlot < 0) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking: |
||
| { | ||
| return false; | ||
| } | ||
|
|
||
| var input = AudioDevices.ResolveInput(configuration.CallInputDevice); | ||
| var output = AudioDevices.ResolveOutput(configuration.CallOutputDevice); | ||
| var created = new CallSession(callId, connection, input, output, volume) { Muted = muted, }; | ||
| if (localSlot >= 0) | ||
| { | ||
| created.SetLocalSlot(localSlot); | ||
| } | ||
| created.SetLocalSlot(localSlot); | ||
|
|
||
| session = created; | ||
| remoteSlots.Clear(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking: latching on failure kills the refetch storm but makes the failure permanent for the session. The page then renders the
shareReadReceipts/sharePresencedefaults (bothtrue) as authoritative, andPushsends both booleans, so flipping one silently overwrites the other server-side. Latch only whenme is not null, and give the failure path a retry cooldown instead.