Commit graph

1203 commits

Author SHA1 Message Date
Bruno Windels
aeedb948cc pass logger to Storage and make it available in Transaction 2021-09-17 18:19:26 +02:00
Danila Fedorin
82c35355b6 Start translating GapWriter tests to using MockTimeline 2021-09-16 23:54:13 -07:00
Bruno Windels
9a9b206bf5
Merge pull request #486 from vector-im/bwindels/fix-scroll-jumps
Fix scroll jumps and loading of gaps not at top of the timeline
2021-09-16 17:14:17 +02:00
Bruno Windels
381a12db20 load 20 entries initially in timeline, otherwise it flickers a bit 2021-09-16 16:34:13 +02:00
Bruno Windels
cce8207870 copy Daniel's conversion of EventEmitter to TypeScript from microui 2021-09-16 10:23:03 +02:00
Danila Fedorin
d2b604e1dd Stop using at to fix tests. 2021-09-14 15:57:32 -07:00
Danila Fedorin
df273c5e2c Store more events from backfill 2021-09-14 15:40:15 -07:00
Danila Fedorin
b2b5690739 Add more tests 2021-09-14 13:54:14 -07:00
Danila Fedorin
f8117b6f98 Lift transaction property to QueryTarget 2021-09-14 11:18:24 -07:00
Danila Fedorin
41e568f783 Add more tests and extract common test code 2021-09-14 11:15:13 -07:00
Danila Fedorin
31577cd496 Draft first two tests 2021-09-14 10:24:18 -07:00
Danila Fedorin
b3df37b0bc Add the beginning of a tests function for GapWriter 2021-09-13 17:01:32 -07:00
Danila Fedorin
713f675f3a Mock IDBKeyRange, too 2021-09-13 17:00:49 -07:00
Danila Fedorin
71694787cd Add an IDBFactory mock parameter 2021-09-13 16:55:55 -07:00
Bruno Windels
9411e6f065 WIP 2021-09-10 14:47:05 +02:00
Bruno Windels
5953cdf0cc turns out we do write these 2021-09-06 13:10:36 +02:00
Bruno Windels
35f8c40a0c fix rebase mistake 2021-09-06 13:09:16 +02:00
Bruno Windels
7cb686ce8e convert EventKey to ts 2021-09-06 13:07:41 +02:00
Bruno Windels
85c8415acd convert Direction to ts 2021-09-06 13:06:20 +02:00
Bruno Windels
ed082c9869
Merge pull request #475 from vector-im/snowpack-ts-storage-4
Snowpack + Typescript conversion (Part 4)
2021-09-06 13:05:08 +02:00
Bruno Windels
36da02c14e use generics here to say return type of method is same as callback 2021-09-06 13:01:32 +02:00
Bruno Windels
360b4db17a
Merge pull request #474 from vector-im/snowpack-ts-storage-3
Snowpack + Typescript conversion (Part 3)
2021-09-06 12:55:46 +02:00
Bruno Windels
ad28f1f9a3 split out Entry type for TimelineEventStore 2021-09-06 12:51:28 +02:00
Bruno Windels
cd98cac4e4 split out Entry type for OlmSessionStore 2021-09-06 12:46:44 +02:00
Bruno Windels
5d8e66a3f3
Merge pull request #473 from vector-im/snowpack-ts-storage-2
Snowpack + Typescript conversion (Part 2)
2021-09-06 11:06:46 +02:00
Bruno Windels
6cec583661 fix #483 2021-09-01 14:21:21 +02:00
Danila Fedorin
5b9fd5de94 Import BaseLogger instead of explicitly defining 'any' type 2021-08-31 16:01:13 -07:00
Danila Fedorin
78fb8fdadf Make export types more precise 2021-08-31 15:59:50 -07:00
Danila Fedorin
2262e6be30 Use store name enum for saving stores 2021-08-31 15:44:03 -07:00
Danila Fedorin
de3807f690 Fix IDBKeyRange type 2021-08-31 15:35:01 -07:00
Danila Fedorin
4eabb7c074 Fix newly emerging type errors in schema 2021-08-31 15:32:33 -07:00
Danila Fedorin
7f8089eaff Merge branch 'snowpack-ts-storage-3' into snowpack-ts-storage-4 2021-08-31 15:26:26 -07:00
Danila Fedorin
f34ee53a12 Avoid casting to any when a more specific type is possible 2021-08-31 15:14:21 -07:00
Danila Fedorin
bef02d238f Split keys out of stored data types 2021-08-31 15:12:09 -07:00
Danila Fedorin
f5943ced97 Remove IDBValidKey references 2021-08-31 14:48:38 -07:00
Danila Fedorin
1fcc147da7 Add type to the IDBKeyRange field 2021-08-31 12:16:16 -07:00
Danila Fedorin
056c7d40eb Rename RoomEvent to TimelineEvent 2021-08-31 12:10:36 -07:00
Danila Fedorin
16d3ed579b Reduce IDBValidKey returns to the public API 2021-08-31 11:47:54 -07:00
Danila Fedorin
ce20d40ff7 Revert the return-promise change 2021-08-31 11:31:17 -07:00
Danila Fedorin
eb3f5f1ec2 Merge branch 'master' into snowpack-ts-storage-2 2021-08-31 11:13:10 -07:00
Bruno Windels
995ed23b3e tell TS we're certain to have a txn 2021-08-31 08:43:39 +02:00
Bruno Windels
3d66d71c97 fix conflict 2021-08-31 08:39:12 +02:00
Bruno Windels
f466266a5f bring back extra caution 2021-08-31 08:16:37 +02:00
Bruno Windels
3ded5b20d3 dedupe some code here 2021-08-31 08:16:27 +02:00
Bruno Windels
7fb5412176 keep comment where it was 2021-08-30 15:12:25 +02:00
Bruno Windels
0d6ae19d99 use same code to add room to identity in migration as in device tracker 2021-08-30 15:05:57 +02:00
Bruno Windels
a437332482 whitespace 2021-08-30 14:52:20 +02:00
Bruno Windels
0ca46bf2ac don't log here as we log at a lower level, and don't fail on abort 2021-08-30 14:52:04 +02:00
Bruno Windels
ddb6753f8d fix refactor error 2021-08-27 20:05:53 +02:00
Bruno Windels
6a6762f036 ensure memberwriter works with undefined for state/timeline events array 2021-08-27 20:05:34 +02:00
Bruno Windels
8e6bd6a7a1 add missing room ids to identities for tracked rooms & clear outbound session 2021-08-27 19:39:24 +02:00
Bruno Windels
fa555bedf0 log storage migration 2021-08-27 19:35:11 +02:00
Bruno Windels
0c05e97465 abort upgrade txn on error 2021-08-27 19:07:27 +02:00
Danila Fedorin
9252f3bede Migrate StorageFactory to TypeScript 2021-08-27 09:30:16 -07:00
Danila Fedorin
5db9d1493a Migrate export to TypeScript 2021-08-27 09:30:16 -07:00
Danila Fedorin
04e39ef9e2 Migrate quirks to TypeScript 2021-08-27 09:30:16 -07:00
Danila Fedorin
34b173a057 Migrate schema to TypeScript 2021-08-27 09:30:16 -07:00
Danila Fedorin
eae820f91b Migrate Storage to TypeScript 2021-08-27 09:30:15 -07:00
Danila Fedorin
5f3c9cda97 Migrate Transaction to TypeScript 2021-08-27 09:30:15 -07:00
Danila Fedorin
100aee9dcc Migrate InboundGroupSessionStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
914abda7c9 Migrate OlmSessionStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
3cd0d1f423 Migrate DeviceIdentityStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
8d44df83c4 Migrate UserIdentityStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
b46ae152d6 Migrate PendingEventStore.js to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
fad6d63c14 Migrate TimelineFragmentStore.js to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
742ab28099 Migrate AccountDataStore.js to TypeScript. 2021-08-27 09:30:10 -07:00
Danila Fedorin
77f75fd968 Migrate OperationStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
8c966627bc Migrate GroupSessionDecryptionStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
33d94b9497 Migrate OutboundGroupSessionStore to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
5d4454734a Migrate RoomStateStore.js to TypeScript 2021-08-27 09:30:10 -07:00
Danila Fedorin
af70269169 Merge branch 'snowpack-ts-storage-1' into snowpack-ts-storage-2 2021-08-27 09:29:53 -07:00
Danila Fedorin
4c4687a05f Avoid unsafe (and error-prone) cast 2021-08-27 09:29:02 -07:00
Bruno Windels
a61f052fe8 fix lint 2021-08-27 17:23:32 +02:00
Bruno Windels
826de7e9cb Write all members of a sync in one go
so state member events written but not causing a memberChange.hasJoined
don't prevent timeline member events for the same user from doing so
2021-08-27 17:11:29 +02:00
Danila Fedorin
b081aa171c Merge branch 'snowpack-ts-storage-1' into snowpack-ts-storage-2 2021-08-26 17:08:00 -07:00
Danila Fedorin
904a2cbe74 Merge branch 'master' into snowpack-ts-storage-1 2021-08-26 17:07:25 -07:00
Danila Fedorin
a95704528f Merge branch 'snowpack-ts-storage-1' into snowpack-ts-storage-2 2021-08-26 17:01:23 -07:00
Danila Fedorin
b7d232d56d Remove unnecessary cast and restrict constructor parameter type 2021-08-26 16:56:03 -07:00
Bruno Windels
d0c1ddb51b add failing test 2021-08-26 15:18:31 +02:00
Danila Fedorin
6d6821319e Merge branch 'snowpack-ts-storage-1' into snowpack-ts-storage-2 2021-08-24 11:19:36 -07:00
Danila Fedorin
1707df71df Try to reduce repitition in CursorIterator 2021-08-24 11:11:30 -07:00
Bruno Windels
cb9606a87b remove dead code for incomplete memory store 2021-08-24 15:33:41 +02:00
Bruno Windels
e105bc4237 fix lint warnings 2021-08-24 15:31:18 +02:00
Bruno Windels
d1412e1f42 don't retry with www.{host}, as it's a minor security issue
if www.host gets hacked (e.g. a bad wordpress plugin), it could spread
to the matrix server running on a different host.
2021-08-23 20:05:42 +02:00
Bruno Windels
59605a2a57 don't fail login on missing cors on well-known 2021-08-23 19:53:33 +02:00
Bruno Windels
c7b47bb8d6 fix homeServer misspelling to homeserver across the project 2021-08-23 19:26:39 +02:00
Bruno Windels
3a5b7c1d0e support well-known lookup 2021-08-23 18:47:36 +02:00
Bruno Windels
577c3168e6 make queryLogin abortable 2021-08-23 15:54:06 +02:00
Bruno Windels
3b693c5b02
Merge pull request #453 from MidhunSureshR/sso-login
[SSO] - [PR 4] - SSO/Token login functionality
2021-08-23 11:38:48 +00:00
RMidhunSuresh
c9fbafb909 Also check LoadStatus.Error
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-23 15:12:40 +05:30
Danila Fedorin
e610087a79 Merge branch 'snowpack-ts-storage-1' into snowpack-ts-storage-2 2021-08-20 12:51:23 -07:00
Danila Fedorin
a2ff02e6c0 Try using an enum for store names. 2021-08-20 12:33:06 -07:00
Danila Fedorin
69953e5277 Migrate TimelineRelationStore.js to TypeScript 2021-08-20 11:23:27 -07:00
Danila Fedorin
e3b1d034f0 Migrate TimelineEventStore.js to TypeScript 2021-08-20 11:23:21 -07:00
Danila Fedorin
7de704ef86 Migrate InviteStore.js to TypeScript. 2021-08-20 11:23:14 -07:00
Danila Fedorin
7c56ac7746 Migrate RoomMemberStore.js to TypeScript 2021-08-20 11:23:08 -07:00
Danila Fedorin
38a38e8287 Migrate common.ts 2021-08-20 11:23:01 -07:00
Danila Fedorin
e284224cc8 Migrate RoomSummaryStore.js to TypeScript. 2021-08-20 11:22:53 -07:00
Danila Fedorin
144e391c82 Migrate SessionStore.js to TypeScript. 2021-08-20 11:22:45 -07:00
Danila Fedorin
be4ad66b12 Merge branch 'snowpack-ts-storage-1' into snowpack-ts-storage-2-fix 2021-08-20 11:21:03 -07:00
Danila Fedorin
0b8acb51a4 Switch errors to using nulls 2021-08-20 10:41:15 -07:00
Danila Fedorin
50b7a8a3fd Add a comment explaining CursorIterator 2021-08-20 10:34:06 -07:00
Danila Fedorin
94ff76711c Use 'in' to be more idiomatic 2021-08-20 10:04:22 -07:00
RMidhunSuresh
c650b35831 resetStatus from within startLogin
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-20 20:05:36 +05:30
RMidhunSuresh
2468bc3e9f Remove homeserver prop
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-20 15:47:30 +05:30
RMidhunSuresh
bdc860eb79 Refactor to pull loadvm into login vm
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-20 15:19:42 +05:30
Danila Fedorin
19bababa68 Use method syntax in QueryTarget. 2021-08-19 17:40:10 -07:00
Danila Fedorin
704a8d99c7 Add missing return types to QueryTarget 2021-08-19 17:39:53 -07:00
RMidhunSuresh
3af2ae3bdd make method private
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-19 20:50:00 +05:30
RMidhunSuresh
2d842c7174 rename ssoEndpointLink to createSSORedirectURL
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-19 20:50:00 +05:30
RMidhunSuresh
83f4095d88 rename queryLogin to getLoginFlows
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:05:15 +05:30
RMidhunSuresh
7b9ec5516a Move normalizeHomeserver into session container
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:33 +05:30
RMidhunSuresh
4b72b64a2e Implement SSOLoginHelper
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:33 +05:30
RMidhunSuresh
3fa955e594 Parse token/sso login in loginOptions
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:33 +05:30
RMidhunSuresh
66f28b90fc Implement token login
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:33 +05:30
RMidhunSuresh
0af27fc8dd Move normalizeHomeserver to LoginViewModel
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:33 +05:30
RMidhunSuresh
f3946fcdf3 Pass log as argument
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
9651817c5b Formatting fix
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
730a6b2d0a Move files to separate directory
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
46b7d9a373 Add explaining comment
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
72fb7f679b Add license headers
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
acfe3f30db Make lint happy
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
a53e29767f Rewrite password login to use PasswordLoginMethod
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
20765d9688 Create LoginMethod for password login
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:04 +05:30
RMidhunSuresh
e0fcec9102 Add method to query login types
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-18 22:04:02 +05:30
Bruno Windels
4b5f5ddffa fix ts lint error by making methods abstract 2021-08-18 18:15:03 +02:00
Bruno Windels
02e422f3ac
Merge pull request #448 from vector-im/snowpack-mvp
Snowpack MVP
2021-08-18 13:09:02 +00:00
Danila Fedorin
db66570d7a Migrate Store.js to TypeScript 2021-08-17 16:33:07 -07:00
Danila Fedorin
c4e8ed8851 Migrate QueryTarget.js to TypeScript 2021-08-17 16:30:05 -07:00
Danila Fedorin
28ee87cd2f Migrate error.js to TypeScript 2021-08-17 16:30:05 -07:00
Danila Fedorin
aa9839ee40 Seemingly fix a bug in utils.ts 2021-08-17 16:30:05 -07:00
Danila Fedorin
cd9fe360a4 Start migrating utils.js to TypeScript 2021-08-17 16:30:05 -07:00
Danila Fedorin
5579c018d1 Migrate common.js to TypeScript
Add initial stab at annotating common

Add missing return types and semicolons
2021-08-17 16:30:05 -07:00
Danila Fedorin
8ec8de67b8 Merge branch 'snowpack-mvp' into snowpack-ts-storage-1 2021-08-17 16:29:47 -07:00
Bruno Windels
c3177b06bf
Merge pull request #418 from vector-im/replies
Sending replies
2021-08-06 21:28:42 +00:00
Danila Fedorin
3c5b186e31 Switch BaseEntry to TypeScript 2021-08-06 12:54:06 -07:00
Danila Fedorin
ac044cb5c2 Rename pending event fields 2021-08-06 10:27:17 -07:00
Danila Fedorin
1207203b00 Prefer relations from encrypted content 2021-08-06 10:22:43 -07:00
Danila Fedorin
5a0bc55e54 Rename reply function in reply.js 2021-08-06 10:16:20 -07:00
RMidhunSuresh
be57352f71 Move PowerLevels.js into /room
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 19:49:48 +05:30
RMidhunSuresh
1a062f69fd Check state_key is zero-length string
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 19:02:50 +05:30
RMidhunSuresh
d85cf982cc Check if state_key is present
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 17:34:21 +05:30
RMidhunSuresh
187cf5cd28 Use optional chaining
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 17:23:01 +05:30
RMidhunSuresh
2cae7c41d3 Check timeline before state
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 17:15:40 +05:30
RMidhunSuresh
4ddc7c0683 Update powerlevels in afterSync
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 17:15:40 +05:30
RMidhunSuresh
40128c7ff6 Set pl from room response
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 17:15:40 +05:30
RMidhunSuresh
b75760c437 Add event type string
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-06 17:15:40 +05:30
Bruno Windels
73884cff0d
Merge pull request #412 from MidhunSureshR/member
Member panel - PR 1 - Add method to fetch member
2021-08-05 11:13:52 +00:00
RMidhunSuresh
7e481080b5 Return null
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
2021-08-05 16:32:06 +05:30
Danila Fedorin
06961ff693 Add isReply flag to entries 2021-08-04 15:30:35 -07:00