-
Notifications
You must be signed in to change notification settings - Fork 376
Added cache control for http request within BrowserClient #1706
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
base: master
Are you sure you want to change the base?
Conversation
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 add tests for this. There are cache testing examples here:
void testCache() { |
This comment was marked as duplicate.
This comment was marked as duplicate.
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.
Remember to write tests! ;-)
PR HealthChangelog Entry ✔️
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 |
@brianquinlan I will add tests but, I want to make sure that everything goes good within the design. |
@brianquinlan Hello, I am back once again. |
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
}); | ||
|
||
test('#send a GET with default type', () async { | ||
var client = BrowserClient(cacheMode: CacheMode.defaultType); |
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.
You are only doing a single request here so I'm not sure how this is testing the caching behavior.
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.
Nope, it is two GET requests, when it is set to default type it is cached once.
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.
I guess, I need to drain the request so, I can see the difference.
client.close(); | ||
expect( | ||
response.body, | ||
parse(anyOf(containsPair('numOfRequests', 2), |
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.
Shouldn't numOfRequests
always be 2?
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.
Yes, see most of other tests.
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.
Do you have other suggestions regarding the tests? @brianquinlan
Added cache control for BrowserClient and passed 85 conformance tests including fixes in tests for html runtime.