Commit Graph

81 Commits

Author SHA1 Message Date
Reto Brunner
845dabad53 Fix sqlite query invocation in test
46da1abba4
changed the types of the db functions... fix our code to deal with it.
2023-03-17 10:57:21 +01:00
Reto Brunner
958a948456 sqlite: Remove client from sqlitestorage
The only reason we accepted a client was that so we have access
to the next message id when we need it.
So let's accept an id provider function instead.
2022-12-30 16:52:04 +01:00
Reto Brunner
2d4143b779 sqlite: synchronize enable() internally
TL is stupid and doesn't wait for message{Provider,Storage} to
settle before it starts using the store.

While this should be fixed globally, we can hack around the problem
by pushing everything onto the call stack and hope that we'll eventually
finish the setup before we blow the stack.
2022-11-30 10:28:26 +01:00
Reto Brunner
deeea274da Merge branch 'sqlite_cleanup'
Converts sqlite to async, providing a way forward
for migrations to actually happen
2022-11-24 09:45:01 +01:00
Reto Brunner
8095d9e88a SearchQuery: offset is always a number
Fix type confusion that specified offset to be a string, it is
always a number.
2022-11-15 18:50:52 +01:00
Reto Brunner
d62dd3e62d messageStorage: convert to async
Message stores are more complicated that a sync "fire and forget"
API allows for.
For starters, non trivial stores (say sqlite) can fail during init
and we want to be able to catch that.
Second, we really need to be able to run migrations and such, which
may block (and fail) the activation of the store.

On the plus side, this pushes error handling to the caller rather
than the stores, which is a good thing as that allows us to eventually
push this to the client in the UI, rather than just logging it in the
server on stdout
2022-11-02 00:01:36 +01:00
Max Leiter
dd05ee3a65
TypeScript and Vue 3 (#4559)
Co-authored-by: Eric Nemchik <eric@nemchik.com>
Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
2022-06-18 17:25:21 -07:00
Reto
d4cc2dd361
Refactor config out of Helper (#4558)
* Remove config from Helper

Helper is the usual util grab bag of useful stuff.
Somehow the config ended up there historically but
structurally that doesn't make any sense.

* Add cert folder to prettier ignore file
2022-05-01 12:12:39 -07:00
Val Lorentz
20ed3e6dc5
sqlite: Escape '%' and '_' in search queries. (#4487)
I picked '@' arbitrarily, it doesn't matter much.
I just don't like '\' because it needs to be escaped itself in the JS code,
which is annoying.
2022-04-11 17:49:13 -07:00
Reto
d228a8c4f4
Bump most deps (#4453) 2022-02-09 15:27:34 -08:00
itsjohncs
044cd2403b Small cleanup of messageStorage/sqlite.
* Extend test coverage to the `search` function.
* Test sort order of messages from `getMessages` and `search`
* Move reversal of `search` results from Vue to messageStorage.
* Remove unnecessary uses of `sqlite.serialize` in tests.
* Return promises from test functions where possible.
2021-10-28 00:48:11 -07:00
Jay2k1
b97b145df1 add highlight exceptions 2020-08-19 00:00:56 +02:00
Pavel Djundik
8c6460b58a Disable link prefetching for urls with no schema specified 2020-08-04 20:21:12 +03:00
Dexter Chua
2f434be75d Add option to disable media preview.
This disables image previews iff prefetchStorage is disabled. This
stops the client from making any requests to third-party sites.
2020-07-21 08:52:02 +08:00
Pavel Djundik
f8f692af05 Generate client certificates and automatically do SASL EXTERNAL 2020-04-15 10:56:04 +03:00
Pavel Djundik
6de6f8185e Clean up folders in after test runs 2020-03-22 20:43:06 +02:00
Pavel Djundik
881b3eda19 Run format after updating to prettier 2.0 2020-03-21 22:55:36 +02:00
Pavel Djundik
1b2894bf99 Fix increasing test timeout on github actions 2020-02-09 14:21:45 +02:00
Pavel Djundik
26bf0850d7 Stub checkForUpdates in tests 2020-01-19 01:14:52 +02:00
Pavel Djundik
d2932ccea8 Correctly track user toggle of previews 2019-12-23 12:26:57 +02:00
Pavel Djundik
769585e72d Collapse prefetch errors by default 2019-12-23 12:15:23 +02:00
Pavel Djundik
72a954b865 Add preview for text/plain urls 2019-12-19 15:12:02 +02:00
Pavel Djundik
8b7fb33627 Increase test timeout due to unpredictable I/O on CI services 2019-11-27 20:25:29 +02:00
Raqbit
95cc9a47fb Add file size to link preview 2019-11-07 16:58:28 +01:00
MiniDigger
6f8364b1dd Print package versions on startup 2019-11-06 18:02:28 +01:00
Pavel Djundik
fe4e0343a4 Load existing users on startup when LDAP is enabled
Fixes #3219
2019-10-31 11:01:44 +02:00
Pavel Djundik
390a0b8e83 Let OS generate a port in link prefetch tests 2019-10-04 14:19:04 +03:00
Pavel Djundik
cee3a50ddc Move back to ldapjs dependency
Fixes #3381
2019-09-15 22:42:27 +03:00
Alistair McKinlay
133e7bf710 Format js/vue with prettier 2019-07-19 11:27:40 +01:00
Pavel Djundik
54a4085b68 Store ip and language in a separate object in user file 2019-07-16 13:00:29 +03:00
Pavel Djundik
95a3ec42c2 Add a message about experimental API 2019-07-05 10:26:22 +03:00
Alistair McKinlay
4cbe72f635 Add support for command plugins 2019-07-02 17:02:05 +01:00
moundahiwale
c30684aad1 Assert LDAP bind failed error and search warning log messages in ldap tests 2019-01-05 23:08:10 +00:00
Pavel Djundik
11bd2dfa4c Increase delay between links to remove random test failure 2018-07-06 12:29:21 +03:00
Pavel Djundik
472d618033 Remove log from global 2018-06-15 23:31:06 +03:00
Pavel Djundik
0d48c596c8 Fix multiple <title> tags being concatenated 2018-06-11 11:32:32 +03:00
Pavel Djundik
4e2523060b De-duplicate link fetching to one request at once 2018-06-11 10:38:03 +03:00
Ben Harris
d2987d037c use http for protocol-less URLs 2018-06-09 13:46:46 -04:00
Pavel Djundik
0de90daa64
Merge pull request #2366 from thelounge/xpaw/refactor-userlog
Refactor userLog to be the same as sqlite logger
2018-05-26 23:53:17 +03:00
Pavel Djundik
5cfec76d3a Refactor userLog to be the same as sqlite logger
Fixes #1392
2018-05-23 16:56:18 +03:00
Pavel Djundik
97dfdbf7c0 Default to https: for urls with no scheme 2018-05-23 16:50:59 +03:00
Pavel Djundik
d4fa6bbcb0 Use WHATWG URL parser in link prefetcher 2018-05-23 16:31:02 +03:00
Pavel Djundik
629ae8bfa4 Fix protocol-aware urls, add better link validation in previews 2018-05-23 16:31:02 +03:00
Pavel Djundik
886301e765
Merge pull request #2396 from thelounge/xpaw/fix-2341
Use per-client channel and message ids
2018-05-01 13:26:38 +03:00
Jérémie Astori
1daad45f11
Use the new logo for favicons, notifications badges, and homescreen app icons 2018-04-28 12:14:41 -04:00
Pavel Djundik
bf8a16b7fe Use per-client channel and message ids
Fixes #2341
2018-04-27 13:16:23 +03:00
Pavel Djundik
a222dc9237 Ensure sqlite tests are serialized 2018-03-25 16:00:48 +03:00
Pavel Djundik
ca96d09a23 Send Accept header
Closes #2277
2018-03-23 20:17:03 +02:00
Jérémie Astori
c86ea9463d
Use Sinon to stub the logger instead of manual stubbing 2018-03-20 01:54:04 -04:00
Pavel Djundik
351a203acd Fix some URLs not being sent as-is to the client 2018-03-13 22:08:19 +02:00