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

"may be locally edited" check often results in false positives #1866

Closed
uncenter opened this issue Dec 29, 2024 · 4 comments
Closed

"may be locally edited" check often results in false positives #1866

uncenter opened this issue Dec 29, 2024 · 4 comments

Comments

@uncenter
Copy link
Contributor

Description or the shortest sequence of actions to replicate the problem

I've had this frustration before but especially so now. Seems like the check for if a userstyle has been edited locally is overaggressive or something and incorrectly flags many. I pushed a commit that changed the versioning of many userstyles from semver to calver, and Stylus thinks that every single userstyle has been locally edited (I have not locally edited most of them, with maybe one exception) and refuses to update.

Screenshot or a screen recording

N/A

System Information

  • OS: macOS
  • Browser: Arc (Chromium) 131.0.6778.205 (Official Build) (arm64)
  • Stylus Version: stylus-chrome-mv3-2.2.0-8fe35a4
@uncenter uncenter added the bug label Dec 29, 2024
@tophf
Copy link
Member

tophf commented Dec 29, 2024

I never encounter this problem personally, so it'd be helpful if you can provide a concrete sequence of actions I can perform.

@uncenter
Copy link
Contributor Author

Hmm I wonder if this issue arises because of a bit of a hack used to add the userstyles. We generate a custom Stylus export file programatically, containing preloaded userstyles, which is then loaded back into Stylus as a backup. Notably this export lacks the _id and _rev fields for each userstyle entry, which may cause this?

@tophf
Copy link
Member

tophf commented Dec 29, 2024

The check makes use of originalDigest in the style data. When there's no hash Stylus cannot verify the style is safe to update, which is the reason for this feature in the first place. Adding it in your generator should solve the problem.

@uncenter
Copy link
Contributor Author

Thanks, much appreciated!

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

No branches or pull requests

2 participants