Skip to content

fix: cookie fetch missing function #14

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

Merged
merged 1 commit into from
Apr 25, 2025
Merged

Conversation

nerodesu017
Copy link
Contributor

Cookie fetch function was missing while its signature was present in the interface, making the app crash.

@nerodesu017 nerodesu017 requested a review from ospfranco April 23, 2025 21:03
Copy link
Contributor

@ospfranco ospfranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use a semaphore it will block the ui

@nerodesu017
Copy link
Contributor Author

@ospfranco
Copy link
Contributor

Ah, this function needs to be sync to return the data... let me take a look

@ospfranco
Copy link
Contributor

Ok, yeah, there is no way to make this function sync so it can return data to the Lua side without emitting an event. Ideally though, we would add an observer into the Cookie store used by the webview and just keep a map of the cookies ourselves.

Here is the reference for adding an observer:

https://developer.apple.com/documentation/webkit/wkhttpcookiestore/add(_:)?language=objc

Going to merge this for now, with the caveat that it's a slow function that blocks the UI when called.

@ospfranco ospfranco merged commit 7a6b5f1 into main Apr 25, 2025
1 check passed
@ospfranco ospfranco deleted the nero/fix-cookie-fetch branch April 25, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants