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

Don't fail to start up if lazy load check fails #759

Merged
merged 3 commits into from
Oct 10, 2018

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Oct 10, 2018

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

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
@dbkr dbkr requested a review from a team October 10, 2018 16:01
dbkr added a commit to matrix-org/matrix-react-sdk that referenced this pull request Oct 10, 2018
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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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`;
Copy link
Contributor

Choose a reason for hiding this comment

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

s/stopthe/stop the

@bwindels bwindels merged commit 72e77d2 into develop Oct 10, 2018
@t3chguy t3chguy deleted the dbkr/lazy_load_check_before_sync branch May 10, 2022 14:20
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.

2 participants