Commit graph

7694 commits

Author SHA1 Message Date
Val Lorentz
0dd74a93bf tests/server: Tear down test fixtures in the order they were setup
if for whatever reason before() fails to import the server, it causes after()
to fail on the first line, so it doesn't restore stubs; causing other errors
to be printed in other tests ("TypeError: Attempted to wrap warn which is
already wrapped")
2023-03-17 17:12:29 +01:00
Reto Brunner
4e954b919c server/client: refactor command input
Keep happy path on the left and try to return as early
as we can to help the reader understand the logic better

The function is too large to be able to quickly scan an if / else
chain and see the function return at the end
2023-03-17 11:28:54 +01:00
Reto Brunner
eb509f7100 Fix config typing and make Client easier to test 2023-03-17 11:03:50 +01:00
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
6b00ccf82b update dependency webpack to v5.76.0 2023-03-17 10:19:43 +01:00
renovate[bot]
34a01c2dd1
chore(deps): update dependency sqlite3 to v5.1.6 2023-03-15 19:08:51 +00:00
Val Lorentz
320075e376 Remove override of UserConfig 2023-03-15 11:49:13 +01:00
Val Lorentz
d58fb84565 Fix test wording 2023-03-15 08:40:53 +01:00
Val Lorentz
a049a01aeb Client: move socket connection out of the constructor
It will make it easier to write tests for what used to be in
the connect() method
2023-03-15 08:40:53 +01:00
Val Lorentz
76098d7e76 Fix incorrect typing of dehydrated networks and channels
Client and ClientManager deal with both 'dehydrated' channels/networks (ie. directly
from JSON configuration) and the 'rehydrated' ones (classes, with socket objects,
message arrays, etc.).

However, because their attributes are similar, both types were used interchangeably,
which becomes an issue when splitting Client's configuration loading into smaller
methods.
2023-03-15 08:40:53 +01:00
renovate[bot]
a67cee1ee4
chore(deps): update dependency webpack to v5.76.0 [security] 2023-03-14 22:38:59 +00:00
Reto Brunner
efd24fd12c packaging: Use an include list in package.json 2023-03-14 07:35:50 +01:00
renovate[bot]
bc4c3082b8
chore(deps): update dependency sqlite3 to v5.1.5 [security] 2023-03-14 00:17:53 +00:00
Reto Brunner
d471a4c959 packaging: Use an include list in package.json
Rather than playing whack a mole with an exclude list, let's use
an include list instead.
2023-03-12 17:44:21 +01:00
Reto Brunner
4831c20804 update dependency webpack-dev-middleware to v5.3.3 2023-03-12 12:33:10 +01:00
Reto Brunner
eddcbcc766 update dependency vue-loader to v17.0.1 2023-03-12 12:32:48 +01:00
Reto Brunner
0183d89384 update dependency sinon to v13.0.2 2023-03-12 12:32:28 +01:00
Reto Brunner
95e56300db update dependency postcss to v8.4.21 2023-03-12 12:32:12 +01:00
renovate[bot]
8e249d46af
chore(deps): update dependency postcss to v8.4.21 2023-03-12 11:18:55 +00:00
renovate[bot]
50e8d2a890
chore(deps): update dependency @vue/test-utils to v2.3.1 2023-03-10 04:58:30 +00:00
Reto Brunner
7f6059d5b7 input/raw: use the irc-framework api
We are not allowed to mess with the connection object directly
according to the public api surface of the framework
2023-03-04 18:17:17 +01:00
Reto Brunner
8ca9ee873b use the irc connected helper function
We should not mess with irc-framework internals.
Technically we shouldn't even access the connection object,
it's not part of the documented API surface
2023-03-04 18:16:28 +01:00
Reto Brunner
402332340b pluginCommand: type it and guard against bad input 2023-03-04 17:00:53 +01:00
renovate[bot]
4742a07721
chore(deps): update dependency webpack-dev-middleware to v5.3.3 2023-03-01 00:16:25 +00:00
renovate[bot]
2f8dc01930
chore(deps): update dependency vue-loader to v17.0.1 2023-03-01 00:15:55 +00:00
Reto Brunner
fade6a8d2e network: add getLobby accessor
This documents what we actually want and allows us to shift the
logic to the network
2023-02-27 18:30:33 +01:00
Reto Brunner
dfed1dd757 skip migrations if the user has disabled logging 2023-02-27 14:33:34 +01:00
Reto Brunner
d67277d996 clientManager: Expose user config 2023-02-27 14:33:34 +01:00
Reto Brunner
95aaba43fa cli: Implement storage migrate subcommand
This introduces the ability to run the migration offline, while
TL is not running as the migrations can take a long time.

The migrate command is added as a `thelounge storage` subcommand.
Reason being that it is expected that more subcommands will follow,
say `thelounge storage clean` to remove partial data from the db.
2023-02-27 14:33:34 +01:00
Reto Brunner
3e7255ff20 sqlite: Add primary keys to the messages table
We want primary keys to never get re-used to so that we
can implement jump to messages / context fetching etc
in the future.

This isn't hooked up yet at all to the rest of the code, only
the schema is changed
2023-02-27 14:20:31 +01:00
Reto Brunner
86e376fc03 sqlite: run migrations on startup 2023-02-27 14:20:31 +01:00
Reto Brunner
899762cddd sqlite: Add infrastructure for migration tests
This sets up the testing infrastructure to test migrations we are
doing.
It's done on a in memory database directly, we are only interested
in the statements themselves and it's easier than to try and
inject a prepared db into the store.

We do add some dummy data though to make sure we actually execute
the things as we expect.
2023-02-27 14:20:29 +01:00
Reto Brunner
063aca948c sqlite: don't hardcode version test 2023-02-27 14:17:04 +01:00
Reto Brunner
25642fbe98 sqlite: delete table creation test
This just repeats the hard coded values from the code, which
is not helping.
We need to touch that test whenever we modify the sql which is
undesired and it doesn't test any useful functionality.

Any error that may ensue would hopefully be tracked by the other
test.
2023-02-27 14:11:47 +01:00
Max Leiter
c2e7390127
Merge pull request #4685 from thelounge/networkProps
network: don't force existence of constructor properties
2023-02-26 17:23:23 -08:00
Max Leiter
d10a59395c
Merge pull request #4684 from thelounge/userProps
user: don't force existence of constructor properties
2023-02-26 17:22:31 -08:00
Max Leiter
8fc696620f
Merge pull request #4683 from thelounge/chanProps
models/chan: don't force existence of constructor properties
2023-02-26 17:22:06 -08:00
Max Leiter
c6a202d6ab
Merge pull request #4686 from thelounge/decoupleServer
Decouple server
2023-02-26 17:20:20 -08:00
Max Leiter
7c9ed14909
Merge pull request #4695 from maxpoulin64/fix/oidentd-crash-race-condition
Don't crash on oidentd socket race condition
2023-02-25 13:44:37 -08:00
Reto Brunner
bdc1f23107 fix formatting 2023-02-18 11:46:31 +01:00
Reto Brunner
e9a09f5447 Add id to error log 2023-02-18 11:35:52 +01:00
Reto Brunner
d93cd88dd5 Fix uploader mount/unmount lifecycle #4691 2023-02-18 11:16:30 +01:00
Pavel Djundik
2f04150461 Fix git commit not being available in dist build 2023-02-15 12:03:08 +02:00
Max Leiter
c816e4053e
Merge pull request #4692 from thelounge/irc-framework
bump irc-framework to 4.13.1
2023-02-13 20:56:38 -08:00
Max Leiter
4cff2ccabe
Link to PR in log.warn 2023-02-13 20:51:27 -08:00
Max Leiter
26b7fbf2c0
Apply suggestions from code review
Co-authored-by: Mina Galić <me+github@igalic.co>
2023-02-13 20:50:16 -08:00
Maxime Poulin
243cb10e2a
Don't crash on oidentd socket race condition 2023-02-08 22:05:22 -05:00
dependabot[bot]
7304acd8e0
build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-06 21:21:55 +00:00
Reto Brunner
511209a100 bump irc-framework to 4.13.1 2023-02-06 22:20:40 +01:00
Maxime Poulin
2ce374fe85 Fix uploader mount/unmount lifecycle
Currently, in `ChatInput.vue` we call `upload.abort()` which removes the event listeners, which are never added back. This effectively permanently disable uploads if the user navigates away to Settings or any other non-chat pages, and back.

Moves the binding to `mounted()` so that they're properly rebound when a chat window is in view, and also adds an `unmounted()` for clarity.

This should also fix an edge case if the page opens up on a non-chat page and there was never a ChatInput to unbind it, such as login page or add network pages.
2023-02-05 22:32:12 -05:00