Bring timestamps of (pubspec.yaml, pubspec.lock, dart_tool/package_config.json) in order even if files are not modified
@sigurdm actually, I think there is a bug here...
If I modify
pubspec.yamlby adding a comment, the timestamp is updated. Butpub getbails out and doesn't touch the other files because nothing actually changed. However to the IDE,pubspec.yamlnow looks newer than the other files, so we think we need to runpub get.I don't know if https://github.com/dart-lang/pub/issues/1447 will fix this or if it also just uses the timestamps. But if it does fix it, it still requires all clients to adopt it, so I think it would be best if the timestamps were still made consistent?
Originally posted by @DanTup in #4588
As a workaround for this in Dart-Code (since a fix hitting stable is going to be at least a quarter away and the prompts are annoying), I'm going to touch the pubspec.lock/package_config.json after a successful pub get.
https://github.com/Dart-Code/Dart-Code/pull/5760
This is guarded on a version check for >= Dart 3.7.0, and once this issue gets fixed I'll add an upper bound for the version it's fixed in.
@sigurdm let me know if you have any concerns with this (or think I should do it differently). Thanks!
I think that should be fine