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

attempt to recover from various invalid session forms... #209 #218

Conversation

tmack8001
Copy link
Collaborator

@tmack8001 tmack8001 commented Jan 24, 2021

Regardless of fixing the way these files can get corrupted like this. Simply a brew session that misses a "complete" or otherwise isn't marked correctly as finished (existing or otherwise) we should look at recovering as many as we can (short of a power outage in the middle of writing a line in the file).

A long term fix for "invalid written JSON structure" can be found in #216 and I'll defer fixing the "problem" until then. I've run this locally where on my system I have 6 different types of invalid sessions across the different types of devices and this fixes nearly all of them (short of the session files that have invalid names ie '#' in the filename, wrong date string, non integer, etc).

current behavior with the new try/except handling from another PR
invalid sessions (if the contents aren't parsable, but the filename is valid) show up as empty sessions now
image

proposed session recovery change
with this proposed session recovery change (we should likely update again a bit later to just re-write the file if the session is recovered successfully...)
image
image

cc/ @Rudder2 I've tested in the above screenshot with your invalid RINSE and invalid HopHeads files here as well.

@tmack8001 tmack8001 marked this pull request as draft January 24, 2021 12:05
@tmack8001 tmack8001 marked this pull request as ready for review January 24, 2021 12:31
@Rudder2
Copy link

Rudder2 commented Jan 24, 2021

@tmack8001 Awesome! Can't wait to see it in action. Really appreciate the effort going in to creating a refined server. I haven't connected to "Mothership" going on 3 months.

I've asked PicoBrew for years to make an offline sever so I could brew while at sea and it fell on deaf ears. They only suggested hotspot your phone... You made being off grid with PicoBrew machines possible. Thank y'all so much.

@chiefwigms chiefwigms merged commit 72110dc into chiefwigms:master Jan 24, 2021
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