It should be noted that /badge/update needs some more planning so 1 more commit
is justified for it as some consideration must be taken for how individual badge
permissions are going to be handled
The badges_id field has proved to bubble up some issues with updating deep structures
Basically this just means that feature branches for deep features like this are a good idea
! Issue: RTC feature flag was working fine but without the feature flag `Row`'s had no pickup
This meant correct responses were slipping into previously unreachable sections of code
With this frontend points now return proper data structures which of course contain
badge_id vectors
Along with defaulting to '[]' strings in mysql configuration serde_json calls
now fallback to .unwrap_or(Vec::new()) for cheapish callbacks.
These fallback calls are cheap because Vec::new doesn't allocate anything on the heap
because they're empty.
This patch has not yet been tested but will be in the coming patches
Sumamary: we're just doing a regular delete on the neighbor's table based off
the url field
* add_neighbor now takes a moved Neighbor param instead of the fields individually
This should make it a easier for both front & backend to parse what's happening.
It also let's us leveraege serde_json a bit more
It should be noted at this point we're considering url's as the "primary key"
even though its kinda weird to use them that way.
Even though a varchar primary key doesn't really scale well I'm considering it
fine for now as the neighbors table is controlled by admins(by hand) and hopefully
won't need to scale.
! wat - because have to do maintain permissions on a per request level we have
to do this check for permissions at what is basically every level, this does
mean we have to hit the database for a lot of routes however there is a check
that requests go through in order to avoid hitting the database whenever possible
+ rng field in claims now has real purpose
It's purpose is to act as a validator field in the jwt table. By verifying rng
fields we no longer have to store whole jwt's
This dep was already there but just being used (as we're using serde). Now we can use it at the db layer which makes neighbor struct creation easier
* Cargo locks are being updated to reflect new dependancy changes
These changes actually reduce the dependancy count overall
+ Adding a very simple table to hold all the neighbors that an instance may want to reference
At some point we may want to support vanity join urls and this would be a good place to reference those
There would also need to be a way for admins to add/edit/remove vanity urls but that's for another patch
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
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
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
This version comes with the benefit of having much more concise exec_map functionality among other things
This commit and the following ones also move db-lib to using a more 'try' based approach
* Renamed db helper function to be (debatably) more clear in its intentions
That function and everything in that module is quickly become awful however
+ Adding some notes for later db-lib development
! Initial id size will stay as u64 but u128 are easily the next major change
This change shouldn't break clients written in high level languages since most already use 128's under the hood anyway
- This commit also removes the auto_increment flag from basically everything that uses RNG id's
! Requirements for variable message fetching not yet met
! /message/get?id=<id> needs a way of passing back file contents
! The file upload is sketchy at best and not necessarily guaranteed to sync the
database with the file system
* Fixed weird match with get_online_members
+ Now using special(smoll) Public Member struct for public member data fetches as.
They're size on networks should be pretty small so we can package a ton of them in a single request
DOCS changes:
- Removing references to unix timestamps in seconds
- Removing references to joindate
* Exact content-type values now specified
Removig chrono from api code as well
Removing chrono as dep in api code
+ Using Content-Type for /message/send content type
Updating cargo lists for removal of fluff deps
Removal of more fluff
Addking makefile to avoid compiling debug builds by accident while developing
➕ /channels/list now takes a "type" parameter which defaults to TEXT_CHANNEL(1)
✨ Refactoring db::Channel::filter to use a more latency friendly approach
✨ db::Channel::Filter now returns Result<Response<Self>, SqlError>
➕ Moving Messages struct in db-lib to root for less namespacing uglyness
➖ Removing an whole unused trait
✨ Message::get_time_range now returns a special 'UserMessage' struct that includes the name of the author
❗ More code must be removed from db-lib since a ton of the trait methods aren't used anymore