-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix processing same image multiple times #6573
Conversation
🦋 Changeset detectedLatest commit: e746af1 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hmm, this is fine, but I wonder if there isn't an issue higher in the chain that we should fix before doing this fix that would hide other issues. For instance, in the Markdown one, there's 9 empty Markdown files, and yet a bunch of images are being added. Maybe there's some sort of global state not being reseted correctly. |
Hmm, maybe. It's also possible to avoid adding duplicated value for Map by iterate for keys of the map and check objects equality by value of object. I mean something like this https://lodash.com/docs/#isEqual, not |
The real underlying bug here is an unnecessarily nested |
Thank you for contributing! As this logic was completely removed in #6604, this PR is no longer relevant, so I'll be closing this. Hopefully, the new logic should fix this issue as well! |
@Princesseuh Thank you for your fix, a problem I couldn't figure out the cause had been fixed. My issue due to this line.
Using an object as Map 's key, and this object is created each time this function is called.
So, I guess this issues not only me, but also users who using
Without this PR's change, every time So, I appreciate if you reopen this or fix this issue in more performant way :D |
This will be tackled in a separate PR, because there was two issues at play. There was an issue that was specific to Markdown (which is what my PR fixed, and what the other PR also fixed) and there's the issue you're having with The issue for that one is still open here: #6489. I'm hoping to fix this in a more "deep" way |
Changes
Fix #6564, close #6489
Testing
I didn't test only this change.
I'm using astro with few more patches and just extracted only this part, but this changes are very simple and don't even need to verify, I think.
Docs
No changes for usage