Skip to content

MutationObserverWatcher seems not working on twitter/ui/fetch #184

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

Closed
Misaka-0x447f opened this issue Sep 13, 2019 · 5 comments
Closed

MutationObserverWatcher seems not working on twitter/ui/fetch #184

Misaka-0x447f opened this issue Sep 13, 2019 · 5 comments

Comments

@Misaka-0x447f
Copy link
Contributor

Misaka-0x447f commented Sep 13, 2019

https://github.com/DimensionDev/Maskbook/blob/4d7e551b03ae6dc0f4dc3cdd2753ff1da1a5cf46/src/social-network-provider/twitter.com/ui/fetch.ts#L48\

image

The length in the image represents how many element selected by this dynamic selector at this time (via elevate()). It changed from 0 to 11 but .forEach only run once.
image

@Misaka-0x447f Misaka-0x447f added the Blocked: Upstream this issue cannot be done because of upstream broken. label Sep 13, 2019
@Jack-Works
Copy link
Member

Here is a edge case in Watcher and I don't know if that helps.

Watcher use rAF lock to run checks during each run, if a new task scheduled when the rAF lock is locked, it will be ignored. Watcher should run one more time to check if there is any change during the rAF locking (but it doesn't do it currently).

Do some DOM change and check if your problem resolved, if it runs the forEach call after you manually do a DOM change, it is the Watcher bug.

@Misaka-0x447f Misaka-0x447f removed the Blocked: Upstream this issue cannot be done because of upstream broken. label Sep 13, 2019
@Misaka-0x447f
Copy link
Contributor Author

Misaka-0x447f commented Sep 13, 2019

This could be my bad since I realized that in some cases in exception will not visible in firefox console. I tried to replace your's with a more simpler version this afternoon but the problem consists. Then I found that maybe some exception happened but not shown in the console.

@Misaka-0x447f
Copy link
Contributor Author

  • they are only visible if a try...catch added to the call of callbackFn. Maybe same thing should be done on the @holoflow/kits.
    image
    image
    In this piece of code, if no try/catch, no exception.

@Misaka-0x447f
Copy link
Contributor Author

*but you can catch it by 'pause on exception'.

@Jack-Works
Copy link
Member

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