This commit is contained in:
Bruno Windels 2019-02-10 22:02:42 +01:00
parent 35648d31b9
commit a544c25d58
5 changed files with 31 additions and 18 deletions

View file

@ -3,4 +3,8 @@ A javascript matrix client prototype, trying to minize RAM usage by offloading a
## Status ## Status
Not working yet Sort of syncing, but not really yet.
## Troubleshooting
You need to disable the browser cache to see your updated code when refreshing

View file

@ -1,11 +1,24 @@
# Minimal thing to get working # Minimal thing to get working
- finish summary store - DONE: finish summary store
- move "sdk" bits over to "matrix" directory - DONE: move "sdk" bits over to "matrix" directory
- add eventemitter - DONE: add eventemitter
- make sync work - DONE: make sync work
- store summaries - DONE: store summaries
- setup editorconfig - setup editorconfig
- setup linting (also in editor) - DONE: setup linting (also in editor)
- store timeline - DONE: store timeline
- store state - DONE: store state
- make summary work better (name and joined/inviteCount doesn't seem to work well)
- timeline doesn't seem to recover it's key well upon loading, the query in load seems to never yield an event in the persister
- map DOMException to something better
- it's pretty opaque now when something idb related fails. DOMException has these fields:
code: 0
message: "Key already exists in the object store."
name: "ConstraintError"
- emit events so we can start showing something on the screen maybe?
- move session._rooms over to Map, so we can iterate over it, ...
- build a very basic interface with
- a start/stop sync button
- a room list sorted alphabetically
- clicking on a room list, you see messages (userId -> body)

View file

@ -4,7 +4,6 @@ export default class RoomPersister {
constructor(roomId) { constructor(roomId) {
this._roomId = roomId; this._roomId = roomId;
this._lastSortKey = new SortKey(); this._lastSortKey = new SortKey();
} }
async load(txn) { async load(txn) {

View file

@ -4,6 +4,7 @@ export default class Session {
constructor(storage) { constructor(storage) {
this._storage = storage; this._storage = storage;
this._session = null; this._session = null;
// use Map here?
this._rooms = {}; this._rooms = {};
} }
// should be called before load // should be called before load

View file

@ -37,10 +37,8 @@ export default class RoomTimelineStore {
this._timelineStore.add({ this._timelineStore.add({
roomId: roomId, roomId: roomId,
sortKey: sortKey.buffer, sortKey: sortKey.buffer,
content: { event: null,
event: null, gap: gap,
gap: gap,
},
}); });
} }
@ -49,10 +47,8 @@ export default class RoomTimelineStore {
this._timelineStore.add({ this._timelineStore.add({
roomId: roomId, roomId: roomId,
sortKey: sortKey.buffer, sortKey: sortKey.buffer,
content: { event: event,
event: event, gap: null,
gap: null,
},
}); });
} }