[comixed-dev] Re: Application state and session tracking

  • From: Frédéric Fouret <fouretfrederic@xxxxxxxxx>
  • To: comixed-dev@xxxxxxxxxxxxx
  • Date: Sat, 14 Nov 2020 18:23:29 +0100

The general concept seems clear. I'm not sure how you want to set this up
yet, but it sounds interesting.

Le jeu. 12 nov. 2020 à 21:38, Darryl L. Pierce <mcpierce@xxxxxxxxx> a
écrit :

One of the things I'm thinking about doing is to replace how we
current do updates (asking the backend for changes to comics) with a
server-side session state. What that means is that the backend server
would have a session object for each logged in user, would store that
session in the database, and for each session update would reload it,
look at what's changed and then return the deltas. No more loading
just add/update events and kludging in other changes: it would become
a more holistic means of updating the state of things for all users
connected to the system.

On the server side we can have listeners registered for any database
changes, such as comics added/deleted/updated, reading list changes,
etc.. Whenever these changes occur, all user session objects would get
notice of those changes. The changes would be tracked by entry type
(comic, reading list, etc.) and queued for the next update by
timestamp of when the change occured. Then when the browser asks for
an update, it would get specific instructions of what's changed on the
backend.

If the user logs out, the session is discarded.

If the user reloads their browser, the update request will send a 0 as
the timestamp and the session would be restarted because of this and
all of those details reloaded.

I'm still working through how the updates will work, but I think the
above description (assuming it was clear enough, so please ask
questions if it's not) should help set a basic understand of what we
can do moving forward.

--
Darryl L. Pierce <mcpierce@xxxxxxxxx>
"Le centre du monde est partout." - Blaise Pascal
"Let's try and find some point of transcendence and leap together." -
Gord Downie


Other related posts: