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
Lite: Fix the analytics module to use asyncio to work in the Wasm env #5045
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d4be722
Fix the analytics module to use asyncio to work in the Wasm env
whitphx 42f04ad
add changeset
gradio-pr-bot 90127ae
add changeset
gradio-pr-bot 052f2bd
Add changeset
whitphx 07a341c
Revert "Add changeset"
whitphx 96c4f56
Add the `is_wasm` field to the analytics telemetry
whitphx 70bbfc2
Restore the initialization code in Blocks.launch() in the Wasm env
whitphx 152db85
Remove a call of analytics.version_check() in Blocks.launch() in the …
whitphx 2b87bc8
Add a `type: ignore` directive to the line of importing the `pyodide`…
whitphx f134298
Fix a test case
whitphx 2c87d7c
Refactor _do_wasm_analytics_request() and add a unit test for it
whitphx 6f58292
Merge branch 'main' into wasm-compatible-analytics
whitphx b77247c
Get the IP address for analytics in the Wasm mode
whitphx 593803b
Merge branch 'main' into wasm-compatible-analytics
abidlabs File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"gradio": minor | ||
--- | ||
|
||
feat:Lite: Fix the analytics module to use asyncio to work in the Wasm env |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the current
get_local_ip_address()
doesn't work in the Wasm env, and even if we make its Wasm-compatible version, gathering users' public IP-address looks too much, I hardcoded the string literal representing the failure of IP address detection.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by looks too much. Do you mean that its too intrusive? Or that its not techincally feasible?
The reason that I ask is that main benefit of collecting analytics is that it allows us to measure daily, weekly, and monthly unique users which we might not be able to do if we don't collect IP addresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt it's too intrusive.
In the case of Gradio-lite, this telemetry will be sent from clients' device immediately after they open the app page, where they don't have any chance to set
analytics_enabled=false
to opt-out it. I think some amount of people consider it as a bad behavior to automatically access the third-party API (https://checkip.amazonaws.com/
) to get the IP address and send it as analytics data, under the recent situation where people are sensitive to data privacy.However, getting IP addresses itself might be allowed as long as they are not logged or properly stored securely (I'm not sure), so I would like some advice from experts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a commit including the IP address fetcher (b77247c), though we should revert it if it looks not good anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @whitphx. Let's keep it for now -- as part of #4226, we might replace the IP address with a hash of the IP address so that we can still keep a track of unique users without sending IP addresses.