Replies: 1 comment 2 replies
-
Specifically this is referring to Corrupt session data is a state that we leave up the store implementation to define behavior for. As an example, a store could look for decode errors and then decide to clear the store or reset the bad record entry and proceed without bubbling the error up to the caller. The session store API boundary intentionally leaves these kinds of decisions up the implementer because we don't want to be too opinionated about what semantics will best suite a particular use case. Taking a step back, our design borrows heavily from Django's, which also loads upon insert (in fact, this happens whenever the underlying dict is referenced, via Python's magic methods). |
Beta Was this translation helpful? Give feedback.
-
When inserting data to the session the .insert() function reads the previously stored data before inserting the new data. While this generally is not an issue issues may arise if bad data gets saved into the session.
However, if the read errors with a decode error the new data ends up never getting inserted and instead the insert function just errors on decoding the old data.
Generally I think the insert function should either ignore possible decode issues or there should be an insert function which doesnt even attempt to read the previous session.
The same issue also kind of applies to .remove() as it also reads the previous value which means that
Beta Was this translation helpful? Give feedback.
All reactions