-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Don't fail to start up if lazy load check fails #759
Conversation
Do the lazy loading check in the batch of things we do before starting a sync rather than at client start time, so we don't fail to start the client if we can't hit the HS to determine LL support. Fixes element-hq/element-web#7455
js-sdk now emits sync state ERROR with an InvalidStoreError if the store needs to be cleared before it can be used. Requires matrix-org/matrix-js-sdk#759
src/sync.js
Outdated
// if we don't know any better | ||
let lazyLoadMembersBefore = false; | ||
const isStoreNewlyCreated = await this.client.store.isNewlyCreated(); | ||
console.log("store newly created? "+isStoreNewlyCreated); |
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.
want to keep this in?
src/sync.js
Outdated
if (prevClientOptions) { | ||
lazyLoadMembersBefore = !!prevClientOptions.lazyLoadMembers; | ||
} | ||
console.log("prev ll: "+lazyLoadMembersBefore); |
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.
same here, guess this is a leftover?
src/sync.js
Outdated
} | ||
// need to vape the store when enabling LL and wasn't enabled before | ||
const shouldClear = await this._wasLazyLoadingToggled(this.opts.lazyLoadMembers); | ||
console.log("was toggled? "+shouldClear); |
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.
leftover?
src/sync.js
Outdated
} | ||
if (this.opts.lazyLoadMembers) { | ||
const supported = await client.doesServerSupportLazyLoading(); | ||
console.log("server supports ll? "+supported); |
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.
leftover?
src/errors.js
Outdated
@@ -2,7 +2,7 @@ | |||
// because of http://babeljs.io/docs/usage/caveats/#classes | |||
function InvalidStoreError(reason, value) { | |||
const message = `Store is invalid because ${reason}, ` + | |||
`please delete all data and retry`; | |||
`please stopthe client, delete all data and start the client again`; |
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.
s/stopthe/stop the
Do the lazy loading check in the batch of things we do before
starting a sync rather than at client start time, so we don't fail
to start the client if we can't hit the HS to determine LL support.
Fixes element-hq/element-web#7455