Skip to content
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

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

hrajwade96
Copy link
Contributor

@hrajwade96 hrajwade96 commented Sep 21, 2024

Adding offline support to Network page.

issue link - #4470

List which issues are fixed by this PR.

Please add a note to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md if your change requires release notes. Otherwise, add the 'release-notes-not-required' label to the PR.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or there is a reason for not adding tests.

build.yaml badge

If you need help, consider asking for help on Discord.

@hrajwade96 hrajwade96 requested review from bkonyi, kenzieschmoll and a team as code owners September 21, 2024 09:19
@hrajwade96 hrajwade96 marked this pull request as draft September 21, 2024 09:19
@hrajwade96 hrajwade96 changed the title added initial implementation Offline support for Network page Sep 21, 2024
@kenzieschmoll
Copy link
Member

@hrajwade96 is this PR ready for review or is this still a work in progress?

@hrajwade96
Copy link
Contributor Author

@hrajwade96 is this PR ready for review or is this still a work in progress?

@kenzieschmoll just finishing up few things, I will mark it ready soon

@hrajwade96 hrajwade96 marked this pull request as ready for review October 2, 2024 17:19
@hrajwade96 hrajwade96 marked this pull request as draft October 23, 2024 15:13
@hrajwade96 hrajwade96 marked this pull request as ready for review October 27, 2024 14:32
SocketJsonKey.id.name: id,
SocketJsonKey.startTime.name: startTime,
SocketJsonKey.endTime.name: endTime,
//TODO verify if these timings are in correct format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please address this TODO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While testing I noticed 2 issues :

  1. The timings in socket stats are having discrepancy in online and offline mode - I thought this could be due to _timelineMicrosBase but I tried adding/ removing it there was still a discrepancy. Is it due to some time zone or formatting issue? I am trying to figure out.
  2. The Request and Response data is missing in offline mode - I think it's because full fetch is not called, if we want to call where can we ideally call it?

Attaching SS for 1st point :
Online mode
image

Offline mode
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another point is that in offline mode data of socket and http requests is grouped when it's populated.
I think we should show them in their original order as the requests came in? Perhaps we can pack them in a combined way instead, or other way is to reorder before rendering based on timestamps (once we fix the timings) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually past 2 weeks I've been on vacation, and then unwell so got very little time to investigate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table should already sort the data by timestamp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (3) is there any simple way to add anther check for showing exit offline cta?
such as whenever it is disconnected, current check doesn't seem to work after page refresh

Copy link
Contributor Author

@hrajwade96 hrajwade96 Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW I will be unavailable here for the next 4 days (27th - 1st Dec)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For point 3 (offline mode data disappearing after a page refresh): this is a known issue and should be fixed holistically for the offline framework. This is out of scope for this PR, so you don't need to worry about this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For point 2, can you just call await _fetchFullDataBeforeExport() at the beginning of prepareOfflineScreenData like we do at the beginning of the exportAsHarFile method?

Copy link
Contributor Author

@hrajwade96 hrajwade96 Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, so only point 2 and pipeline checks needs to be addressed.
For this I had thought of doing the same i.e. calling await _fetchFullDataBeforeExport() at the beginning of prepareOfflineScreenData, but for that we will have to mark prepareOfflineScreenData as async, and it's parent and other implementations too, and await wherever it's called is that fine?

Btw I tried running by making these changes but getting below exception while _fetchFullDataBeforeExport() is called (I've put a try catch here) :
exception in prepareOfflineScreenData getIsolate: (-32000) Service connection disposed

Looks like the service connection is already disposed by the time prepareOfflineScreenData is called.

Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test coverage for this change. Thanks!

Copy link
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple more comments. Thank you for all your work on this change!

@kenzieschmoll
Copy link
Member

Looks like there are several failing checks. Please also add an entry to NEXT_RELEASE_NOTES.md so that the release notes check passes.

@kenzieschmoll
Copy link
Member

You will likely have several merge conflicts after pulling in the tip of the master branch. A change just landed that upgraded the Flutter version used in DevTools, which updated to a new version of the dart formatter. Here's what I recommend to make this merge simpler for you:

  1. Merge the master branch into your branch.
  2. For all conflicts, accept your revision of the file..
  3. Run dt update-flutter-sdk. This will update the flutter sdk contained at tool/flutter-sdk to the version used on the DevTools CI.
  4. Run tool/flutter-sdk/bin/dart format from the devtools_app directory. This will format your files with your changes to use the new formatter.

…fline_support

# Conflicts:
#	packages/devtools_app/lib/src/screens/network/har_data_entry.dart
#	packages/devtools_app/lib/src/screens/network/network_screen.dart
#	packages/devtools_app/lib/src/shared/http/http_request_data.dart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants