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

Clean stale DeviceConnections #1747

Merged
merged 1 commit into from
Jan 11, 2025
Merged

Clean stale DeviceConnections #1747

merged 1 commit into from
Jan 11, 2025

Conversation

joshk
Copy link
Collaborator

@joshk joshk commented Jan 10, 2025

I noticed in the DB that we have several old/stale device connections.

Upon looking into this more, I realised that when we added the DeviceConnection schema and relationships, we didn't add a way to clean the stale connections, which might linger due to unforeseen circumstances, like the app crashing.

When we added the `DeviceConnection` schema and relationships, we didn't add a way to clean the stale connections, which might linger due to unforeseen circumstances, like the app crashing.
@joshk joshk force-pushed the clean-stale-device-connections branch from 42271cf to 1edf1ab Compare January 10, 2025 03:47
@joshk joshk requested review from lawik and nshoes January 10, 2025 04:00
Copy link
Contributor

@lawik lawik left a comment

Choose a reason for hiding this comment

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

Looks like a win ✨

Copy link
Contributor

@nshoes nshoes left a comment

Choose a reason for hiding this comment

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

LGTM!

1.) Since we're here, should we add a function that deletes old device_connections and call it from CleanDeviceConnectionStates?

2.) Could we get a test or two for CleanDeviceConnectionStates?

@joshk
Copy link
Collaborator Author

joshk commented Jan 11, 2025

Sooooo, I'm going to cheat a little.

1.) Since we're here, should we add a function that deletes old device_connections and call it from CleanDeviceConnectionStates?

#1750

2.) Could we get a test or two for CleanDeviceConnectionStates?

#1751

I agree on both your points but I'm going to do those in different PRs so I can at least get the current issue of stale device connection rows fixed. I've created issues for these so they aren't forgotten.

@joshk joshk merged commit 3d506ec into main Jan 11, 2025
2 checks passed
@joshk joshk deleted the clean-stale-device-connections branch January 11, 2025 00:16
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.

3 participants