Commit graph

293 commits

Author SHA1 Message Date
Bruno Windels
fc741272ba only apply sync changes in session once txn is committed 2020-03-14 20:45:36 +01:00
Bruno Windels
224d56698a only set new live key when creating a fragment after the txn succeeds
when doing a limited sync, and a new fragment is created,
this._lastLiveKey is updated immediately. If the transaction
would then fail, the fragmentId in this._lastLiveKey was incremented
but the fragment wasn't written to the store, so if sync is resumed
and would subsequently succeed, fragmentIds would be assigned to events
that don't have a corresponding fragment in the timelineFragment store.

This would throw errors when trying to load the timeline,
breaking the whole app.

This changes SyncWriter to only update this._lastLiveKey in
the emit phase, when the transactions has been committed already.
2020-01-04 20:06:49 +01:00
Bruno Windels
bdc2c3d9ad cleanup: storage is not used in SyncWriter
as the transaction is now always passed as an argument, it never
creates one on its own.
2020-01-04 20:04:57 +01:00
Bruno Windels
29b531ae80 add (commented out) instructions how to use record/replay 2019-12-23 14:29:19 +01:00
Bruno Windels
1d9a5c490a add record/replay network layer 2019-12-23 14:28:42 +01:00
Bruno Windels
aa86748cdd pull fetch code out of homeserverapi 2019-12-23 14:28:27 +01:00
Bruno Windels
35c090dcb4 add proper import/export functionality 2019-12-14 18:29:35 +01:00
Bruno Windels
9c42710f9b add github link to home screens 2019-11-22 09:46:19 +01:00
Bruno Windels
8a55778c32 make sure aliases and heroes aren't empty when picking name 2019-11-22 09:29:18 +01:00
Bruno Windels
325077bcb0 try more domexception fixes 2019-11-21 18:28:18 +01:00
Bruno Windels
5ecf0a6717 fix error path on transaction abort error 2019-11-21 18:23:48 +01:00
Bruno Windels
d073f2825b show json in one line when clearing cache
also make naming consistent
2019-10-24 10:54:20 +02:00
Bruno Windels
d34a0c73b5 show json in list instead of alert so we can copy it 2019-10-13 08:29:23 +02:00
Bruno Windels
6f73d3983f add export/import of session data 2019-10-13 08:16:08 +02:00
Bruno Windels
e2b9e9dfdc add clear cache button for session 2019-10-13 07:48:49 +02:00
Bruno Windels
ad7a150aaa use aliases and heroes to fall back room name to 2019-10-13 07:48:33 +02:00
Bruno Windels
b16f21867c preserve value for storage errors on add and put 2019-10-12 22:19:16 +02:00
Bruno Windels
201b70ee4f fix failing to sync new rooms 2019-10-12 22:18:36 +02:00
Bruno Windels
ac53b9099b only log error in sync loop 2019-10-12 22:18:19 +02:00
Bruno Windels
3ba20dece1 fixup for delete button changes 2019-10-12 22:18:08 +02:00
Bruno Windels
2fa5fa7890 add delete button in session picker 2019-10-12 21:16:48 +02:00
Bruno Windels
d367037332 very basic support for lazy loading 2019-10-12 20:24:09 +02:00
Bruno Windels
076582edc3 css fixes
- don't pronounce avatar initials
 - prevent room header growing wider than screen
 - ensure messages wrap their text
2019-09-28 09:46:09 +02:00
Bruno Windels
e3719b2527 allow http (no sssl) homeservers 2019-09-28 09:44:39 +02:00
Bruno Windels
d8696bea1d add offline availability with service worker and appcache 2019-09-15 14:32:12 +02:00
Bruno Windels
8616d79aad make fetch errors more informative by including method and url 2019-09-15 14:31:50 +02:00
Bruno Windels
2b2b4232e9 moar send logging 2019-09-15 12:25:14 +02:00
Bruno Windels
6f527fd2e0 use openCursor where openKeyCursor is not supported 2019-09-15 12:24:46 +02:00
Bruno Windels
bbf6943455 use .get fallback where .getKey is not supported (Edge 15) 2019-09-15 12:24:27 +02:00
Bruno Windels
8e590fe53b rename and use StorageError to deal with idb DOMerror 2019-09-15 12:23:54 +02:00
Bruno Windels
f7f9129b8b show send errors in UI 2019-09-15 12:23:26 +02:00
Bruno Windels
5a90b4673b fix CORS requests failing 2019-09-15 12:23:08 +02:00
Bruno Windels
ed67689fdf some minimal styling for login and session picker 2019-09-08 10:40:05 +02:00
Bruno Windels
09b9eff7c1 fix remaining errors to make login work 2019-09-08 10:19:16 +02:00
Bruno Windels
a7194e0c7a implement missing views 2019-09-08 10:18:59 +02:00
Bruno Windels
1082233de4 start of session picker view 2019-07-31 00:07:12 +02:00
Bruno Windels
c27172fc4e adjust main to new view 2019-07-31 00:07:04 +02:00
Bruno Windels
49a577991b login and session picker view models, sessions store 2019-07-31 00:06:53 +02:00
Bruno Windels
378eea8ceb
Merge pull request #5 from bwindels/bwindels/sending
Send text messages
2019-07-29 18:28:29 +00:00
Bruno Windels
5b4d984645 height of app should always fill screen (not more or less) 2019-07-29 20:11:15 +02:00
Bruno Windels
de35df10d8 fix test + bug in ConcatList update 2019-07-29 20:03:22 +02:00
Bruno Windels
b723ab4cef add failing test for ConcatList update 2019-07-29 20:03:06 +02:00
Bruno Windels
3b7ab8f1c8 fix MappedList test after passing params as well to updater 2019-07-29 20:02:42 +02:00
Bruno Windels
45cd85ead1 fixup: check for event entry with eventType, event isn't exposed anymore 2019-07-29 19:58:35 +02:00
Bruno Windels
7218595c17 only send message if it's non-empty 2019-07-29 19:54:21 +02:00
Bruno Windels
8665bcb897 concat synced events in timeline with pending events for local echo 2019-07-29 19:53:58 +02:00
Bruno Windels
88a7d64091 fixup: delay not awaited, but not needed for now 2019-07-29 19:53:30 +02:00
Bruno Windels
e23abe209f fixup: leftover from removing access to events 2019-07-29 19:53:07 +02:00
Bruno Windels
bfdff353b0 pass params in map operator update fn 2019-07-29 19:52:28 +02:00
Bruno Windels
7a6e91de84 concat operator for observable lists 2019-07-29 19:18:11 +02:00
Bruno Windels
6f650d19b1 map operator for observable lists 2019-07-29 19:17:55 +02:00
Bruno Windels
0b5c2f9273 better naming 2019-07-29 10:59:49 +02:00
Bruno Windels
b53b60e142 use correct handler and make test succeed 2019-07-29 10:59:07 +02:00
Bruno Windels
0cf7cb36c4 add failing test for unsubscribe using wrong handler 2019-07-29 10:58:27 +02:00
Bruno Windels
9b94c4bb61 don't expose raw event object from entry, pending event doesn't have it
it only has content and *some* of the meta fields,
but we want to threat pendingevententry and evententry as one
and the same in the rest of the application, so don't give access
to entire event object.
2019-07-29 10:27:12 +02:00
Bruno Windels
56cee450d1 return syncing user id from PendingEventEntry.sender
add User class where we later can track display name, avatar, ...
2019-07-29 10:24:34 +02:00
Bruno Windels
b26f7df689 pending events are not certain to be sorted here 2019-07-29 09:54:34 +02:00
Bruno Windels
3ed72df620 put everything together to make it roughly work
no local echo yet, and send errors are being swallowed
2019-07-27 10:51:51 +02:00
Bruno Windels
851100b88a send unsent messages after first sync 2019-07-26 22:40:39 +02:00
Bruno Windels
707988f806 better handle remote echos and hookup in session and room 2019-07-26 22:33:33 +02:00
Bruno Windels
ccb722d766 more WIP 2019-07-26 22:03:57 +02:00
Bruno Windels
f3d1128f28 WIP 2019-07-01 10:00:29 +02:00
Bruno Windels
c5b2d0c8b2 WIP 2019-06-28 00:52:54 +02:00
Bruno Windels
e09d2963df fix timeline scrolling 2019-06-28 00:44:49 +02:00
Bruno Windels
fc873fbfa5 more css fixes, and make back button work for compact layout 2019-06-26 23:14:39 +02:00
Bruno Windels
38a8132397 fix narrow layout 2019-06-26 22:43:59 +02:00
Bruno Windels
cd9f25ea80 convert tabs to spaces where needed 2019-06-26 22:31:36 +02:00
Bruno Windels
90a38078e0 unused import 2019-06-26 22:19:40 +02:00
Bruno Windels
59a303daa0 make user config available from phone on local wlan 2019-06-26 22:19:40 +02:00
Bruno Windels
72c193cce5 page to debug app on mobile phones without remote access to tools 2019-06-26 22:19:40 +02:00
Bruno Windels
b882e0ef8a respect argument count of idb calls
lumia doesn't like undefined arguments if they
are being left out, so call the idb calls with
the exact amount of arguments
2019-06-26 22:02:00 +02:00
Bruno Windels
bbb5e35bcb wrap everything that can throw a idb DOMException in StorageError
as lumia gives very cryptic errors without a stacktrace.
2019-06-26 22:00:50 +02:00
Bruno Windels
0fd52be710 encode idb array keys as sortable strings
that's why numeric parts of the keys have to be encoded
as a fixed length, "big-endian" ordered strings, so
string sorting will also sort the numeric keys correctly.

this also assumes room ids don't contain the "|" character,
we should probably escape the separator at some point.
2019-06-26 21:55:33 +02:00
Bruno Windels
106146660c define storage keys to be 32bit for idb / web platform
as a preparation to serialize the eventIndex and fragmentId
as a 8 character string, part of a concatenated string PK,
as lumia doesn't support array keys.
2019-06-26 21:52:41 +02:00
Bruno Windels
ca4361248f fallback for platforms missing AbortController 2019-06-26 19:49:49 +02:00
Bruno Windels
9cd5257959 load more events when scrolled to top 2019-06-16 17:29:33 +02:00
Bruno Windels
c12300bfa5 make loadList not private when we're going to override it 2019-06-16 17:28:51 +02:00
Bruno Windels
d34a26f0da store new gap entry on update so we can paginate again 2019-06-16 16:47:56 +02:00
Bruno Windels
2131329442 scroll to bottom when loading timeline 2019-06-16 16:39:20 +02:00
Bruno Windels
a1c23f715a always show date for now (but omit year to make it less annoying) 2019-06-16 16:19:26 +02:00
Bruno Windels
d7bc92c391 center placeholder text in both directions 2019-06-16 16:19:00 +02:00
Bruno Windels
b47898e025 show full stack on sync error 2019-06-16 15:49:00 +02:00
Bruno Windels
a09c3e7bed hide sender name if previous message was by same sender 2019-06-16 15:48:54 +02:00
Bruno Windels
4a657b279d apply css from prototype, other small changes, keep scroll at bottom 2019-06-16 15:21:20 +02:00
Bruno Windels
d72a7102b2 only bind className when the obj has at least 1 fn, also support it html 2019-06-16 15:12:54 +02:00
Bruno Windels
590ed56d68 leftover things that got moved during directory org 2019-06-16 10:54:37 +02:00
Bruno Windels
1917a528c7 replace ad hoc buttons and label with SyncStatusBar 2019-06-16 10:54:16 +02:00
Bruno Windels
a4bc2dd2b0 support isOwn on messages 2019-06-16 10:53:23 +02:00
Bruno Windels
a5a333b71a organize view code in directory like viewmodels 2019-06-16 10:53:01 +02:00
Bruno Windels
95e1d55b97 extract argument detection for el and use it in both html and Template 2019-06-15 17:50:54 +02:00
Bruno Windels
03df472c53 show placeholder in middle panel when no room is selected 2019-06-15 17:50:15 +02:00
Bruno Windels
16fed27a8a SwitchView, to alternate between different views 2019-06-15 17:49:45 +02:00
Bruno Windels
db376d3ac6 rename morpheus to brawl 2019-06-14 23:58:39 +02:00
Bruno Windels
ad92356b40 css class same name as prop 2019-06-14 23:46:47 +02:00
Bruno Windels
bec7720c42 cleanup template code 2019-06-14 23:46:31 +02:00
Bruno Windels
468af4755b cleanup html utils 2019-06-14 23:46:18 +02:00
Bruno Windels
5feca5e0f4 gap has its own view now 2019-06-14 23:44:31 +02:00
Bruno Windels
0a6c50b3bb support bindings for className object 2019-06-14 23:08:41 +02:00
Bruno Windels
f9038e2af9 dedicated template view for gaps 2019-06-14 22:55:07 +02:00
Bruno Windels
69be5012e8 templateview exposes viewModel prop 2019-06-14 22:54:51 +02:00