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

Required resources do not update #523

Closed
riveruniversity opened this issue Aug 3, 2023 · 8 comments · Fixed by #525 or #538
Closed

Required resources do not update #523

riveruniversity opened this issue Aug 3, 2023 · 8 comments · Fixed by #525 or #538

Comments

@riveruniversity
Copy link

Hello,

I am using the extension on iOS Safari iPad and iPhone.
I want to clear the cache as instructed but the downloaded JavaScript file does not update.

if you want to update the require resources, and the url does not change, you must remove the resources, save, then re-input it

It works when I change the local file name of the user script.

@riveruniversity riveruniversity changed the title Required resources doesn’t update Required resources do not update Aug 3, 2023
@ACTCD
Copy link
Collaborator

ACTCD commented Aug 3, 2023

@riveruniversity When you say "clear the cache", do you mean you went to a folder and deleted some files manually?
If so, that's not what we expect and instruct you to do.

We'd like you to remove this @require metadata line from the user script, save the script (at which point resources will be deleted), then re-add the metadata line, save again, and resources will get re-downloaded.

@quoid Maybe we should update this note to remove possible ambiguity.

@riveruniversity
Copy link
Author

I’m sorry for lack of clarification. I am actually removing the @require metadata line, saving the script, and re-adding it and saving again as described in your instructions.

@ACTCD
Copy link
Collaborator

ACTCD commented Aug 3, 2023

@riveruniversity Well, that's weird. I tested it locally and it updates fine.

Could you be more specific about the basis of your judgment?
Or, better yet, if you are able to record screen of the entire procedure.

@riveruniversity
Copy link
Author

@ACTCD here is my screen recording of the procedure. I’m updating the library by adding a test function.
https://drive.google.com/file/d/1--623kMyNwG6dgnggpya3ynvzUrw30Mb

@ACTCD
Copy link
Collaborator

ACTCD commented Aug 3, 2023

@riveruniversity OK, I understand. Thanks for the screen recording.

You are using the iOS (iPadOS) version and using an external editor to perform this action.

The instructions in the README are expecting to perform this operation in the built-in editor of the extension page of macOS version.

This difference is the reason for the inconsistent expected results.

When you use an external editor, the save operation does not trigger the extension to perform any action. Nor does it trigger an update to the script resource when you refresh the page later to inject the script.

However, if you open the popup once after save script, it will trigger an update to the script resource. This means that you need to click the extension icon to open the popup once whenever you save in an external editor, to trigger extension read the script changes and update resources.

This is indeed something that needs to be considered and improved in the multi-storage sync refactor issue #452 in the future. But I'll also investigate if there's an easy way to improve the current experience.

@quoid
Copy link
Owner

quoid commented Aug 4, 2023

@quoid Maybe we should update this note to remove possible ambiguity.

Yeah, I think so. Also maybe a note about iOS vs macOS considering this conversation.

@riveruniversity
Copy link
Author

@ACTCD I did open the popup each time after saving the file as you instructed but it didn't work. I will just keep changing the filename of the user script as it's the only way it works for me as for now.

Thank you much.

@ACTCD
Copy link
Collaborator

ACTCD commented Aug 4, 2023

@riveruniversity In the current version, even if you change the file name, you should still need open popup once to detect and refresh external modifications. That should have the same effect as not changing the filename.

I'm not sure now where the problem you're having is.

Anyway, I'm pushing a new PR that will improve the current experience by automatically detecting and updating external modifications without opening the popup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Release
3 participants