« first day (5 days earlier)      last day (121 days later) » 

12:53
alright
@RadvylfPrograms you there?
13:39
@Ginger I am now
whats this
 
1 hour later…
14:49
@RadvylfPrograms niec
so, what do I need to do?
There's a few options:
1. Your replit contacts my server, and basically uses it as a database
2. The users contact my server directly to read the transcripts
3. My server listens in to all of the chat rooms, and no modifications are made to lambda.chat itself
No. 3 is the least practical
2. is not very secure
(bc private rooms)
so I think 1. is best
Okay, sounds good.
So I think we can use a pretty simple API for this
Maybe JSON, an array, with the following commands: transcript (reads from a room), room (adds a room), post (adds a message to a transcript), modify (modify a message)
but rooms can be deleted and stuff
drop_room, drop
But wouldn't we want to keep the transcript anyway?
14:56
mod deletion
Ah, okay. So yeah, add drop_room and drop to that list
Will I store user IDs, or user names?
Can user names change?
names can change, so store IDs
Other than message ID, user ID, timestamp, and content, will I need to store anything else?
hmmm
probably not
but I will note that I intend for messages to be numbered per-room
Yeah, that's fine
What protocol? HTTP POST fine?
15:02
yup
although socket.io does sound tempting
Ooh, maybe a WS would be a good idea
But not socket.io, unless that does normal sockets too
Since socket.io's hella overkill for communication between two servers
socket.io is a convenience layer on top of WS
but yea overkill
More like a slow, laggy compatibility layer for people who want to have IE6 support and eat it too
would a WS be more efficient? testing needed
I mean, very slightly more efficient, but more just...convenient lol
15:05
*laughs in requests*
*cries in node*
The main advantage of a WS would be that it lets my server send transcript data to you asynchronously, which seems...totally useless lol
¯\_(ಠ_ಠ)_/¯
I'm going to go with POST because Python does not have very good WS libraries
15:22
Sounds good
Content-Type: application/json
We can do an array of operations, so that things can be cached and batched up
Sending a POST every few seconds if a room's active seems wasteful
yaes
but then again that means that people wouldn't be able to do anything to a message for a little while
maybe I can find a better WS lib?
the issue with the one I normally use is that it can't do async receiving
I could use this one but I've never used asyncio before
@Ginger Wait why?
because it'll take some time for the message to be synchronised
but if I can figure out how to use WS then I would prefer to
because it just works better for this application
@Ginger Well in theory, my server would just act as storage space for yours. All the synchronization would be after the fact
You'd just send the post and modify in the same batch if they occured in quick succession
just a seccy
I could potentially use a separate thread...
15:34
No no, no need for WS
but like what do I do if someone sends a message and then immediately requests it? I won't have sent it to your server yet so it'll 404
Well you wouldn't immediately forward it to my server, you'd check your cache on your end first
bleuh right
Just abstract it away with a get_message function that handles deciding if it's in the cache
you mean getMessage
alrighty
what address should I use?
15:37
https://rto.run/lambda.chat, I guess
sounds gouda
I can do any of radvylf.com, radvylfprograms.com, rto.run, or amidst.dev though if you'd prefer something else
How will I authenticate? Obviously my server is the only one allowed to use this service
You'll just include a password with every request.
Should we use some sort of fancy protocol to make it change with each request?
30 mins ago, by Ginger
¯\_(ಠ_ಠ)_/¯
15:40
Like sha_256(payload + password)
Actually yeah, let's do that
right...
That way if we accidentally leak stuff while debugging, it'll prevent the password from being public
also, I'm going to encrypt all data sent to your server so you can't snoop on my evil plans
Sounds good. I'd format it as { "id": "[id]", "data": "[encrypted data]" } then
Since I'll be using a hashmap of ids to store things for efficiency purposes
niec
15:44
Go ahead and include all of the data, time stamps, user IDs, message content, whatever, in the data part
That way even the users who are in a private room couldn't be analyzed
Oh, you'd probably need a room key too
Since IDs are per-room
yaes
wait, can you provide me with an example request? I'm a bit confused
[
    {
        "op": "post",
        "room": 14,
        "id": 12,
        "data": "anvwDNU283=="
    },
    {
        "op": "modify",
        "room": 14,
        "id": 1,
        "data": "aj6/4+1==="
    }
]
The data can just be whatever format you want, it'll be stored unchanged. So base64 of encrypted data, a JSON object, whatever.
okeay
keep in mind that I'm not using numbers for room ids
(again, private rooms)
Oh, what are you using?
an 8-character Base64 string
like a YouTube video id
15:50
Ah, that shouldn't matter. base64 or base64url?
url-safe
Personally, I'm a huge fan of base64url and think ordinary base64 shouldn't exist in the first place
Actually, if data will be binary, represented with some sort of base64, could you let me know so I can use Buffers for more efficient storage?
If you're encrypting stuff, binary's pretty likely
Do you want me to add a find_room command to check if there's a room with that ID already?
Also, will I need a table to store information about rooms? Or will room names and access information be stored on your end
I store all of that
nvm I'm gonna use base64 lol
@RadvylfPrograms What's the maximum number of tasks I should send at once?
3.26 million
3.27 million and everything crashes
3.25 million it can handle easily
uhh
okay then
16:00
Realistically, I'd do ~24 at a time
got it
Maybe wait 4 seconds or so after every message after the 24th, and if no messages arrive during that time, send it
If that's complicated then just send after 24
I was going to do send attempts every 3 or so seconds and empty the whole queue of events but that's probably better lmao
is it ok if it occasionally sends more than 24?
Sure
As long as it's less than 3.27 million
actually, I think the "send every 3 seconds" method is best
because when I restart the server any messages in the queue will be lost
16:06
@Ginger That's way more often than needed
@Ginger Just have a sigint handler that sends the remaining stuff in the queue
ok then
You can still lose data with the 3s thing, just less consistently
You're only hiding the problem
that is my speciality
yup
also, how did you make that so fast
16:13
Touchscreen and a blank chrome canvas tab open already
wow
@RadvylfPrograms I need to send you the starting passcode... somehow
maybe I could do the thing you did with pxeger?
I'll just put a text input on my website
Just a sec
Make a temp email and share it?
okay then
@RadvylfPrograms I won't be able to do any work on this 'til I'm home, btw
16:24
so, what format does the key use?
Just make it a string of bytes, maybe 16B
I'm going to use sha256
it's binary data so I guess I'll POST it to ya
what's the address?
Won't have it set up until I'm home, so four hours or so
alrighty
internet having a bad day

« first day (5 days earlier)      last day (121 days later) »