-
-
Notifications
You must be signed in to change notification settings - Fork 256
feat: Add StorageService for offloading large controller data #7192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
278eaa9
e844fdd
19c7d6f
5fedbc0
5af0861
de5388c
e493d3e
81100c2
f5c5aec
04939f6
3fe4314
84adfd5
7ac8bfc
24b150e
65efd41
60efad1
2222e57
ce68a05
afde837
ae501a3
81c9cf8
625eee6
bda7243
d3a7e4e
389e50a
3aeafac
c46e2e2
1b48670
8050f20
9a65054
d6fe459
5b4faeb
363533a
f5ccb18
b5c5d79
8557995
7ccd865
a139816
5598df9
bbd8e39
cf634fb
6bf384a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: Mark Stacey <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,7 @@ export class InMemoryStorageAdapter implements StorageAdapter { | |
| } | ||
|
|
||
| try { | ||
| return JSON.parse(serialized) as Json; | ||
| return JSON.parse(serialized); | ||
| } catch (error) { | ||
| // istanbul ignore next - defensive error handling for corrupted data | ||
| console.error(`Failed to parse stored data for ${fullKey}:`, error); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit dangerous. The caller would have no way to differentiate empty data from data that we failed to retrieve. The caller might then proceed when it's unsafe to do so, or overwrite the data, or something like that. Given that we don't know precisely why the data is being stored/retrieved, or what the consequences of this failure might be, it would be safer to not catch the error and let the caller deal with it. We can highlight that it can throw with a TSDoc |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: This is a legitimate test case, we should be able to test this (even if we do remove the test block). Storage corruption can happen.