Skip to content
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

fix(core): CNX-8692 Fixed regression with AccountManager updating accounts while loading them from SQLite #3138

Conversation

JR-Morgan
Copy link
Member

No description provided.

@@ -257,8 +257,10 @@ public void UpdateObject(string hash, string serializedObject)
{
CancellationToken.ThrowIfCancellationRequested();

using var c = new SqliteConnection(_connectionString);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our AccountManager does some potentially sketchy operations calling UpdateObject while looping through the lazily enumerate return of GetAllObjects. This causes GetAllObjects to return forever, since it returns your updated objects also.

Reverting my change so GetAllObjects and UpdateObject use separate SQLite connections appears to fix things.
I'm a little concerned that we're actually relying on some sort of in-memory cache that the connections use.

I question if this is the behaviour we actually want, it seems to me the problem is with the way the AccountManager is enumerating over a lazy enumerable that its updating. I'll open a ticket for next release to decide on what our desired behaviour here should be.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. We should do some investigation as to why this is the way it works now, as this sounds super dodgy...

@@ -257,8 +257,10 @@ public void UpdateObject(string hash, string serializedObject)
{
CancellationToken.ThrowIfCancellationRequested();

using var c = new SqliteConnection(_connectionString);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. We should do some investigation as to why this is the way it works now, as this sounds super dodgy...

@JR-Morgan JR-Morgan force-pushed the CNX-8692-GetAccounts-information-continuously-queried-from-server branch from d533c1e to d5d8396 Compare January 16, 2024 11:56
Copy link
Member

@AlanRynne AlanRynne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Live reviewed with Jedd

@JR-Morgan JR-Morgan force-pushed the CNX-8692-GetAccounts-information-continuously-queried-from-server branch from d5d8396 to f915518 Compare January 16, 2024 12:17
@JR-Morgan JR-Morgan force-pushed the CNX-8692-GetAccounts-information-continuously-queried-from-server branch from 2dc7cea to 4f423bb Compare January 16, 2024 12:22
@AlanRynne AlanRynne merged commit 1484e92 into dev Jan 16, 2024
30 checks passed
@AlanRynne AlanRynne deleted the CNX-8692-GetAccounts-information-continuously-queried-from-server branch January 16, 2024 12:44
@AlanRynne
Copy link
Member

Merging in! Remember to open a ticket for the unresolved conversation above @JR-Morgan 🙌🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants