randomouscrap98 / contentapi

A generic content system to make some kinda standard websites
GNU General Public License v3.0
8 stars 2 forks source link

Websocket write #136

Closed randomouscrap98 closed 2 years ago

randomouscrap98 commented 2 years ago

Add the ability to write and delete the various object types to the websocket. It was suggested that an ID system should be used to prevent duplicates, since writing over websocket is slightly different to writing on http (?).

If two writes come in from the same user with the same ID, only the first one is honored, the others are not performed. The IDs decay after at least an hour, maybe longer.

Consider how to not duplicate the writing code. Every time we come up with a new type to write, we don't want to have to add it to two places. Technically, the write and delete endpoints could probably be converted to code, but oh well.

The websocket could take advantage of the dbwriter's ultra generic "write" endpoint and just have one method for writing which allows any type. However, you'll have to do research in the API to see if any write or delete endpoints have special code. If so, you may want to consider a special dbwriter wrapper or extension or something which implements ALL the checks and such, so they are consistent across HTTP and websocket

randomouscrap98 commented 2 years ago

12 said no ids needed. I also don't want to do websocket deletes right now, so that'll be another issue. There are other things, such as writing module messages.