Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Offline support for Network page #8332
base: master
Are you sure you want to change the base?
Offline support for Network page #8332
Changes from 4 commits
fe11d5b
6c140b4
0c1f414
e7eeecb
c5ec6f6
131cde6
2a9c4cb
4f473be
ae58738
2bfbe1c
857cfbe
7150436
da11a67
941ec88
852b144
433af38
4644b00
6fd98d0
665ea0d
b6df572
be63db4
91505b5
0715379
ade8b5f
f21a4f6
454ca92
b7b9679
ac726e8
2ea3044
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
please address this TODO.
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.
cast this to the proper type instead:
final httpRequestData = (json[OfflineDataKeys.httpRequestData.name] as List?)?.cast<DartIOHttpRequestData>();
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.
now I have explicitly called fromJson on each object from list, will refactor it and make it into an extension.
BTW one observation is when I remove/comment all the toJson() of all the required classes, and pass the list of DartIOHttpRequestData directly
This still works, as dart is preserving those object types (when we don't serialise them, hence no need for deserialisation).
Since this offline feature is only used in dart (not passed to any external system) and an in-memory thing, is this a good idea to not fully serialise & de-serialise it? and store the inner objects of DartIOHttpRequestData list and Socket and as they are and pick them? Or is it not recommended or safe to use?
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.
In order to download the screen's data as a JSON file, the serialization is required. However, not serializing the data is acceptable for the 'review history' feature, which allows continuing to view recent data offline when the connected app disconnects. I wouldn't worry about distinguishing the two for this PR. This can be a clean up later if the serialization / deserialization for the 'review history' features causes performance issues.
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.
define in one step:
final socketRequestData =(json[OfflineDataKeys.socketData.name] as List?)?.cast<Socket>();
Also, prefer
socketRequestData
oversocketReqData
to avoid abbreviations in variable names