Skip to content

Commit

Permalink
fix IndexedDBStore API documentation
Browse files Browse the repository at this point in the history
changes the changelog entry to include since when this change is needed

fix matrix-org#3986
  • Loading branch information
WebFreak001 committed Jan 5, 2024
1 parent ffc9fb3 commit c50fb08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Changes in [30.0.0](https://github.com/matrix-org/matrix-js-sdk/releases/tag/v30

## 🚨 BREAKING CHANGES
* Refactor & make base64 functions browser-safe ([\#3818](https://github.com/matrix-org/matrix-js-sdk/pull/3818)).
* * `IndexedDBStore.startup()` must be called after using it on `sdk.createClient` now.

## 🦖 Deprecations
* Deprecate `MatrixEvent.toJSON` ([\#3801](https://github.com/matrix-org/matrix-js-sdk/pull/3801)).
Expand Down
4 changes: 2 additions & 2 deletions src/store/indexeddb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class IndexedDBStore extends MemoryStore {
* ```
* let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };
* let store = new IndexedDBStore(opts);
* await store.startup(); // load from indexed db
* let client = sdk.createClient({
* store: store,
* });
* await store.startup(); // load from indexed db, must be called after createClient
* client.startClient();
* client.on("sync", function(state, prevState, data) {
* if (state === "PREPARED") {
Expand Down Expand Up @@ -140,7 +140,7 @@ export class IndexedDBStore extends MemoryStore {
logger.log(`IndexedDBStore.startup: processing presence events`);
userPresenceEvents.forEach(([userId, rawEvent]) => {
if (!this.createUser) {
throw new Error("createUser is undefined, it should be set with setUserCreator()!");
throw new Error("`IndexedDBStore.startup` must be called after assigning it to the client, not before!");
}
const u = this.createUser(userId);
if (rawEvent) {
Expand Down

0 comments on commit c50fb08

Please sign in to comment.