Open Bug 1614025 Opened 2 months ago Updated 2 days ago

Persist data over multiple restarts

Categories

(Chat Core :: Matrix, defect)

defect
Not set

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: clokep, Assigned: khushil324)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

Currently the MatrixClient object that gets created stores data in memory instead of storing it to disk, etc. etc. When repeatedly connection you end up with multiple "devices" connected to your Matrix account, additionally I believe this is what causes the full history to be downloaded each connection.

The createClient docs show how an options object can be passed in to configure the store. I think we want to use the IndexDBStore instead, which uses IndexedDB under the hood.

Assignee: nobody → khushil324
await opts.store.startup();

The code is not moving ahead from this part.
My concern is if we are importing the right IndexedDB.

Attachment #9135143 - Flags: feedback?(clokep)

Hey Khushil, I might have steered you wrong. It seems that IndexedDB.jsm "provides Promise-based wrappers around ordinarily IDBRequest-based IndexedDB methods and classes."

I think we want to use the following instead: Cu.importGlobalProperties(["indexedDB"]); (see https://searchfox.org/comm-central/rev/0c6472bec30280a0648e5101ffacaf72907e4cc2/mozilla/toolkit/modules/IndexedDB.jsm#15-18).

Attachment #9135143 - Flags: feedback?(clokep) → feedback+

There is still an issue: if you click on previous conversation(Today, Yesterday, Last week), you will see the same messages multiple times. It's UI related issue only. I will solve that in follow-up bug.

Attachment #9135143 - Attachment is obsolete: true
Attachment #9135531 - Flags: review?(clokep)
Attachment #9135531 - Attachment is obsolete: true
Attachment #9135531 - Flags: review?(clokep)
Attachment #9137068 - Flags: review?(clokep)
Status: NEW → ASSIGNED

Apply after patches from Bug 1347533 and Bug 1348038.

Attachment #9137068 - Attachment is obsolete: true
Attachment #9137068 - Flags: review?(clokep)
Attachment #9137070 - Flags: review?(clokep)
You need to log in before you can comment on or make changes to this bug.