-
Notifications
You must be signed in to change notification settings - Fork 34
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
Don't follow links when copying paths #1972
Conversation
The original intent of this method was to copy links as links, not to deeply copy the content of linked directories. This was never tested and the original implementation did not have this behavior. Change behavior in place without a major version change since the new behavior is what was intended. Add a test that both the sync and async implementation copies links as links.
Replacement for #1267 |
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). 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.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
Please do not change the current behavior of this function, as the proposed change does not resolve any issue and does not provide an option to retain the existing behavior for backward compatibility. This function has been working reliably for 8 years, and such a change risks breaking numerous third-party implementations. If the current behavior requires clarification, I recommend improving its documentation rather than altering it. Many third-party systems may not detect this change during testing, leading to failures in production. |
It is not a replacement, as this PR still imposes only one behavior. |
Long term backwards compatibility is not generally a goal for packages published under We could certainly consider a major version bump along with this change, I think the both the cost and benefit of a major version bump along with this behavior change are pretty small. It would resolve concerns about silently breaking use cases outside of our internal tools, and require a pubspec change in some number of packages throughout the ecosystem.
It's not clear to me that we have a use case for both behaviors, so imposing one behavior is our preferred approach. As I mentioned in the other thread, if we do think that both behaviors have concrete use cases, I'd want to deliver them in different ways. |
IMHO, whenever possible and simple to implement, backward compatibility should be preserved, especially for general-use packages like
Yes, there are many situations where behavior A or B may be required. This often depends on the developer and the specific software that will use this package. I believe it is simple to add a well-documented parameter, such as your suggestion for I really respect the debate about the change, the correct parameter name, and the originally intended behavior before merging a PR. If you need any help with the final version of this change or its tests, let me know. |
Do you have a specific concrete use case for both behaviors that you can share? |
|
To be clear, See https://pub.dev/publishers/tools.dart.dev/packages and https://dart.dev/resources/dart-team-packages We think it's good when the community is able to reuse our code, but we don't design or maintain the APIs with external use as the primary goal. When we have specific known third party use cases we consider them and often can easily accommodate them. I don't intend to influence API design based on speculative third party use cases. |
I understand the two behaviors and can speculate on use cases, but I don't know the specific concrete use cases for both behaviors. I certainly believe that you have a concrete use case for not deeply copying links, since you opened the PR in the first place, and it was the intended behavior so our original concrete internal use case may have wanted it. I have so far not seen evidence of a concrete use case requiring the current behavior and using this code. |
I didn't know that. If you check the package |
The publisher is linked at the top of the sidebar to the right. The packages that are authored with the primary intent of serving third party use cases will link to the |
I overlooked that |
Ok, but this seems to be internal knowledge, people won't go to tools.dart.dev page to select a package, they will read the README, examples and API. |
closing in favor of #1267 to handle cross device copies, I'll add tests there |
The original intent of this method was to copy links as links, not to
deeply copy the content of linked directories. This was never tested and
the original implementation did not have this behavior.
Change behavior in place without a major version change since the new
behavior is what was intended. Add a test that both the sync and async
implementation copies links as links.