Merged
Conversation
Contributor
julianrubisch
left a comment
There was a problem hiding this comment.
This looks like a sane approach 👍🏻
I'll see if I can check this against an app of mine.
Would be nice if @andrewerlanger did the same, provided you still use it.
Contributor
Author
|
@julianrubisch @andrewerlanger any feedback so far? I'd love to get this merged if everything looks okay. |
Contributor
|
@julianrubisch @leastbad not sure how I missed these messages but only just seeing them now. Sorry for the radio silence and many thanks for pushing ahead with the fix :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of PR (feature, enhancement, bug fix, etc.)
Bug fix
Description
Modify
updates_forelement to verify that a page is required before fetching it.This PR essentially implements the suggestion made in #209, with minor tweaks.
I've done my best to test this new functionality, but I am not a heavy user of
updates_forand would appreciate if @julianrubisch could sanity check this. Specifically, my concern is that there could be an unexpected interaction with lazily loaded Turbo Frame content?I was concerned that filtering out blocks might cause the index-based element selection to point to the wrong element, but so far, I haven't been able to trip it up. I really don't want to break this functionality.
@andrewerlanger I also removed the previous line 117, which was where we performed the
shouldUpdatecheck initially. It seems as though this should no longer be necessary. Is there a good reason to run the check again?I've tested on a simple User model with
enable_updates, as well asnameandemailattributes:Seems to work fine when I update either attribute.
Fixes #209
Why should this be added
@andrewerlanger pointed out that we fetch pages from the server before checking if they are used, which is a waste of computing resources and bandwidth.
Checklist