Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Lately fritter often is asking to create / select profile #49

Open
Gozala opened this issue Oct 3, 2018 · 7 comments
Open

Lately fritter often is asking to create / select profile #49

Gozala opened this issue Oct 3, 2018 · 7 comments

Comments

@Gozala
Copy link

Gozala commented Oct 3, 2018

From what I can tell it's always after I had to kill beaker (but that is most of the time, so may or may not be related). I suspect that indexdb get's wiped or something (will take a look next time it happens).

@pfrazee
Copy link
Member

pfrazee commented Oct 3, 2018

@Gozala have you been using the electron3 branch? That'll cause that. Electron3 makes backwards incompatible changes to the user data directory.

@Gozala
Copy link
Author

Gozala commented Oct 3, 2018

@Gozala have you been using the electron3 branch? That'll cause that. Electron3 makes backwards incompatible changes to the user data directory.

No I'm just using v0.8.0-prerelease.9

@pfrazee
Copy link
Member

pfrazee commented Oct 3, 2018

Huh okay. Well it is possible that indexeddb is getting wiped with kills. Might be why kills are necessary, something getting into a bad state.

@Gozala
Copy link
Author

Gozala commented Oct 3, 2018

Just run into this again, but localStorage seems to have "notificationsLastReadTS" "settings" and indexDB seems to have ton of records as well. So it must be something else.

@Gozala
Copy link
Author

Gozala commented Oct 3, 2018

Ok it seems issue is that userUrl is not in localStorage

var userUrl = window.localStorage.userUrl

Which is surprising (meaning why would that record be deleted). Looking at the source I see two cases where it's being set:

window.localStorage.userUrl = this.currentUser.url

Which is from what I can tell when you create / select a user.

And second instance is on failedToLoadUser:

fritter/lib/app.js

Lines 115 to 119 in 269b81b

if (this.failedToLoadUser) {
// reset so that the user can reconfigure
this.currentUser = null
window.localStorage.removeItem('userUrl')
}

Which seem like it can happen here:

fritter/lib/app.js

Lines 92 to 100 in 269b81b

try {
let info = await this.currentUser.getInfo({timeout: 250})
if (!info.isOwner) throw "Not owner"
this.libfritter.setUser(this.currentUser)
await this.libfritter.prepareArchive(this.currentUser)
} catch (e) {
userUrl = null
this.failedToLoadUser = true
}

Either if loading archive info failed or something in libfritter did. Given that sometimes loading archive can timeout I'm starting to suspect that loading my profile times-out and which in turns removes the record from the localStorage, which makes me wonder if that is a good idea. Maybe it would make more sense to show timeout error and allow reload instead.

@pfrazee
Copy link
Member

pfrazee commented Oct 3, 2018

@Gozala Okay that makes sense. 250ms is pretty short when it could be under load, and definitely shouldnt trigger the undo logic.

@pujux
Copy link

pujux commented Oct 5, 2018

Is this solved or do you need anyone to fix this? Would be happy to help whereever I can!

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

No branches or pull requests

3 participants