* Hopefully fixing pipeline script
Cargo kept trying to rebuild everything so hopefully the new change
forces a usage of artifacts that _should_ be there
Was basically pointless since it's literally just two commands
! full-mock-test job now has scripts/run-api-tests.sh as its source code
This makes it way easier to debug the pipeline when things go wrong as there's
lots of _different_ things going on in that script.
While the script itself is still there it is completely deprecated and safe to remove
at this point
! PAIN Peko
Dependancies might be fucked because gitlab-runner doesn't use deps at all and frankly
I'm completely over doing this stupid patch. Next is decentralized features which is way
more fun to do so if it breaks I'll fix it but its likely an issue with artifacts
* Removing export command from cargo-unit-test job
This was causing the job to fail so the env vars have been moved to live under
the ci file's job-level variables key
* Also I've updated the docker image that this pipeline uses as it didn't have node
and pip installed for some reason
Link to relevant docker image: https://hub.docker.com/r/shockrah/fc-pipeline
* Increasing expries_in flags to be 30 minutes from 15
+ Adding build-keys job which builds hmac keys
+ build-rtc-server: simple build job
* Moving cargo-test-json-api (unit tests) to the bottom with the other tests
! full-mock-tests are now implemented so its time to watch them fail horribly
+ Adding new bootstrapping script for Docker testing pipeline
This build-database script is what is going to setup things like our tables for us
so that we can actually run our test queries
! Basically turning off the ci right now since its going through some large breaking changes
It's going to be broken for a while so there's no point in running it into
a wall of predictable failures
+ Adding some more invite status checks
+ Adding a verbose invite usage check for sanity reasons
- Removing run-api-tests script as it now goes into the /scripts/ directory
+ Adding the wss-hmac setup from the command line arg
It was literally just 1 if statement that I forgot to write in
This is really just for testing purposes since the files tend to be in
awkward to reach path
- Removing if args.len == 0 check
Basically cannon-fodder tbh
* Auth now reads hmac path from environment var
! All of the above is added for the wss hmac as well
+ Adding command line flag [-W/--wss-hmac] to specify wss-hmac file path
Secret value given to user was literally the encrypted secret because I forgot
to rebind it
- removing dev key lmaoooo
These are generated super easily and this key doesn't actually go to anything
so its really not a problem, although it is annoying that its there
+ Moving tests to the new client
- Removing web/ module
! Currently all tests are passing 17/17 but the real trickery comes with doing this
on CI which should will likely take some magic somewhere
Or we'll just extend the freechat docker image to finally have all the required
dependancies and just test on that with diesel and what not
This is really only for check if a particular channel exists for /messages/recent's backend
* Flattening db-lib::Message::last_n
SHould make code more readable as it now has a more linear flow
* api::Messages::recent_messages now 404's when a channel that doesn't exist is request
Problem: the old test suite was extremely inflexible
This meant that making new tests took way too much time.
+ This new rework makes the new client's backend much thinner and less "magical"
With less magic going on we can pass way more data more easily to the actual
http-request engine making the convenience wrapper over top it much more flexible
Translating old tests to the new engine might take a while but for now the old
client codebase is completely deprecated and will no longer be used+updated
Better matching against return types so we're not throwing away errors
This just entails swapping the if let for a match statement
* db-lib::Message::send has more updated docs on what variants of Response it returns
* api::messages::send_message has better error logging now and more relevant comments
This is more heavily used in Message::send as a way of discerning "real" server errors
from those that are caused by user input. The name itself might not be super fitting either
* Moving code for inserting textual messages into its own function
This splits up the logic a bit for Message::send but this segment of logic is also
much simpler than that of file upload
* Flattening Message::send overall
Keeping this function as flat as can be is crucial as it is one of the heavier+most
important funcs in the whole JSON API codebase
Files are now also generated correctly and asynchronously
+ Adding new flags to sample .env file
+ Wrapper script run-api-tests.sh which does as its called
- Removing build.sh in favor of run-api-tests.sh
Makefile takes care of building, and apitests are ran with special script anyway
This api method is made for clients to easily say "give me the n[1,100] latest
messages in some channel
This commit contains code that is largely untested but contains some base code
such that I can correct issues in the next _tested_ commit
+ Better error logging in cache
! There is still lots of debug logs which at some point need to be built _out_ from prod builds
Also I need some prod builds
+ Adding more return type annotations for clarity/docs sake
- Removed ancient docs in messages module as they were basically just straight up wrong
+ messages module was for some reason still using legacy url generation(fixed that)
+ switching types to use bigint since everything is u64/i64 on the backend
Interface for this is fiddly and probably requires real docs to be further developed
without losing my mind doc the whole cache at some point
+ New cache ipc handlers for adding a new open web socket
Web socket comes with some basic listeners, however very litte/nothing
is being done check the health of these connections or to try when possible.
+ Cache now adds actual message objects to its message arrays instead of raw strings (wew)
+ Events module has been added to move the parsing logic/validation away from everything else
+ The basic Event structure has some niftier-than-you-think behavior for data acccess which the cache can leverage for more concise+ correct behavior
! Start taking public user params like this in the JWT to reduce on network hits
It's cheap and reliable enough but the idea just now came to me so do that at some point
+ Cache is no longer contained in app structure
This should let us later throw this into an Arc<Mutex<>> for better
async support.
! Also more cache access safety is being done on the front end because the cahe doesn't guarantee much on access
Perhaps some convenience wrappers would make this look nicer(with inline)
!!! Main needs a lot of flattening
It's technically not much of a problem since most of the code behind 1/2 match's
which really just bloat the hell out of indentation making it look bad when its not _that_ bad.
However it still bugs me so I should probably do something about that(also (inline))
From this point forward the cache should basically just be a data container.
Methods on the cache object are there for convenience and should only ever
return very simple data [booleans, integers, () etc.].
The cache should also have very litter/no concept of commands to decouple it
from the renderer process.
! list_channels is still implemented in the cache however it remaains a vestige
and will be moved to the net module
Also the client is getting some new packages for websocket connections and
while they work some additional work has to be put in to figure out where fug to
actually place the websocket so that it can update the cache+DOM in a seomewhat sensible fashion
Json-bigint should help alleviate this issue by correctly parsing numbers for us
- Removing url method in favor of new url property in server config model
+ Building UserConfigs and ServerConfig from typical JS Obects
This should reduce some up front complexity regarding parameters
! Fix: using new url property instead of protocol + host + port
- Reducing upfront complexity of public channels API
* Also moving to using new updated server.url property
* Channels also handles its part of updating the dom now
bigint parsing in configs now
* More switches to server.url property
Of course this is an issue because we can no longer get data from the user
A full rearchitecting may be in order here however its not impossible to modify the current architecture so far
The main issue here is that the cache is doing too much I think
If the termion(main input) task does its thing, and a socket task,
waits around waiting to build a sub task(socket) then we may be able to
pass messages to the socket task to open up sockets when request
This allows us to have shared state via message passing and a main task
can take care of updating the cache.
The renderer can then request data from the cache when it needs to render stuff