Skip to content

Conversation

@seifibrahim32
Copy link

@seifibrahim32 seifibrahim32 commented Feb 2, 2025

Added cache control for BrowserClient and passed 85 conformance tests including fixes in tests for html runtime.

@seifibrahim32 seifibrahim32 changed the title Added cache control for http request for BrowserClient Added cache control for http request within BrowserClient Feb 2, 2025
Copy link
Collaborator

@brianquinlan brianquinlan 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 tests for this. There are cache testing examples here:

@seifibrahim32

This comment was marked as duplicate.

Copy link
Collaborator

@brianquinlan brianquinlan left a comment

Choose a reason for hiding this comment

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

Remember to write tests! ;-)

@github-actions
Copy link

github-actions bot commented Feb 5, 2025

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ⚠️
File Coverage
pkgs/http/lib/browser_client.dart 💔 Not covered
pkgs/http/lib/src/browser_client.dart 💔 Not covered

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/http/example/main.dart
pkgs/http_client_conformance_tests/example/client_test.dart
pkgs/http_client_conformance_tests/lib/src/dummy_isolate.dart
pkgs/http_parser/test/example_test.dart
pkgs/http_profile/lib/http_profile.dart
pkgs/web_socket/example/web_socket_example.dart
pkgs/web_socket/lib/testing.dart
pkgs/web_socket_conformance_tests/example/client_test.dart

@seifibrahim32
Copy link
Author

seifibrahim32 commented Feb 5, 2025

@brianquinlan I will add tests but, I want to make sure that everything goes good within the design.
@kevmoo I am thinking of changing from String to CacheOption and we get the String type within the enum.

@seifibrahim32 seifibrahim32 requested a review from kevmoo February 5, 2025 22:12
@github-actions github-actions bot added the type-infra A repository infrastructure change or enhancement label Mar 10, 2025
@seifibrahim32
Copy link
Author

@brianquinlan Hello, I am back once again.
The tests are ready..
Waiting to hear back from you.

@github-actions
Copy link

Package publishing

Package Version Status Publish tag (post-merge)
package:cronet_http 1.3.3-wip WIP (no publish necessary)
package:cupertino_http 2.0.3-wip WIP (no publish necessary)
package:http 1.5.0 ready to publish http-v1.5.0
package:http2 2.3.2-wip WIP (no publish necessary)
package:http_multi_server 3.2.2 already published at pub.dev
package:http_parser 4.1.2 already published at pub.dev
package:http_profile 0.1.1-wip WIP (no publish necessary)
package:ok_http 0.1.1-wip WIP (no publish necessary)
package:web_socket 0.1.6 already published at pub.dev
package:web_socket_channel 3.0.2 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@github-actions github-actions bot removed the type-infra A repository infrastructure change or enhancement label Mar 12, 2025
});

test('#send a GET with default type', () async {
var client = BrowserClient(cacheMode: CacheMode.defaultType);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You are only doing a single request here so I'm not sure how this is testing the caching behavior.

Copy link
Author

@seifibrahim32 seifibrahim32 Mar 14, 2025

Choose a reason for hiding this comment

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

Nope, it is two GET requests, when it is set to default type it is cached once.

Copy link
Author

Choose a reason for hiding this comment

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

I guess, I need to drain the request so, I can see the difference.

client.close();
expect(
response.body,
parse(anyOf(containsPair('numOfRequests', 2),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't numOfRequests always be 2?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, see most of other tests.

Copy link
Author

Choose a reason for hiding this comment

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

Do you have other suggestions regarding the tests? @brianquinlan

@brianquinlan
Copy link
Collaborator

Hi @seifibrahim32

This PR is simply taking too much effort to land.

@seifibrahim32
Copy link
Author

I will work on it soon because I was a little bit busy.

@brianquinlan
Copy link
Collaborator

Hi @seifibrahim32,

Even if you find time to work on this, the problem is that it is taking too much effort to review. If you find time to work on this and are confident that you have addressed all pending issues, please reopen.

Cheers,
Brian

@seifibrahim32
Copy link
Author

seifibrahim32 commented Oct 6, 2025

Ok reopen it please and I will start working on them. 🙏@brianquinlan

Because I have no access to re-open it again at the moment unless I closed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants