You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/07/08 17:16:21 UTC
[GitHub] [superset] aspedrosa opened a new pull request #15590: avoid fetching favorite status for anonymous user
aspedrosa opened a new pull request #15590:
URL: https://github.com/apache/superset/pull/15590
Note: this fix won't be visible because since 1.2.0 there is a bug where anonymous users receive an Unexpected Error when viewing a dashboard, however, it will be fixed in #15585
### SUMMARY
This problem had already been fixed in #8527, however, the value of `dashboard.userId` is now being converted into a string [here](https://github.com/apache/superset/blob/301b94f49abef8a2d8e680fcd1c636be6cd45fa4/superset-frontend/src/dashboard/actions/hydrate.js#L339), so in cases of an anonymous user, its value will be `"undefined"`.
With this, the fav star component will render due to [this](https://github.com/apache/superset/blob/301b94f49abef8a2d8e680fcd1c636be6cd45fa4/superset-frontend/src/dashboard/components/Header/index.jsx#L407) condition.
My changes:
Since [hydrate.js](https://github.com/apache/superset/blob/301b94f49abef8a2d8e680fcd1c636be6cd45fa4/superset-frontend/src/dashboard/actions/hydrate.js#L339) says that `dashboard.userId` is legacy, I pass the value of `user.userId` as a prop to the header component, which is value is `undefined` when there is no user logged in.
### TESTING INSTRUCTIONS
1. Add the permission mentioned in [this](https://github.com/apache/superset/issues/14912#issuecomment-876377800) comment to the public role OR set PUBLIC_ROLE_LIKE = "Gamma"
2. Create a dashboard if don't have any
3. Copy the URL for the dashboard
4. Logout or enter an anonymous browser session
5. Enter in the dashboard's URL
6. Check if the error message doesn't appear
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [x] Has associated issue: #14720
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] aspedrosa commented on pull request #15590: fix: avoid fetching favorite status for anonymous user
Posted by GitBox <gi...@apache.org>.
aspedrosa commented on pull request #15590:
URL: https://github.com/apache/superset/pull/15590#issuecomment-877032242
All good for me now, you can merge :wink:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #15590: fix: avoid fetching favorite status for anonymous user
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #15590:
URL: https://github.com/apache/superset/pull/15590#issuecomment-876690774
# [Codecov](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#15590](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2a19d85) into [master](https://codecov.io/gh/apache/superset/commit/86a59a292725f70336e3fa7c1109fec15103fdad?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (86a59a2) will **not change** coverage.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/15590/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #15590 +/- ##
=======================================
Coverage 76.87% 76.87%
=======================================
Files 976 976
Lines 51292 51292
Branches 6907 6907
=======================================
Hits 39430 39430
Misses 11643 11643
Partials 219 219
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `71.42% <100.00%> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ntend/src/dashboard/containers/DashboardHeader.jsx](https://codecov.io/gh/apache/superset/pull/15590/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0Rhc2hib2FyZEhlYWRlci5qc3g=) | `100.00% <ø> (ø)` | |
| [...frontend/src/dashboard/components/Header/index.jsx](https://codecov.io/gh/apache/superset/pull/15590/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0hlYWRlci9pbmRleC5qc3g=) | `67.15% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [86a59a2...2a19d85](https://codecov.io/gh/apache/superset/pull/15590?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] suddjian merged pull request #15590: fix: avoid fetching favorite status for anonymous user
Posted by GitBox <gi...@apache.org>.
suddjian merged pull request #15590:
URL: https://github.com/apache/superset/pull/15590
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] suddjian commented on pull request #15590: fix: avoid fetching favorite status for anonymous user
Posted by GitBox <gi...@apache.org>.
suddjian commented on pull request #15590:
URL: https://github.com/apache/superset/pull/15590#issuecomment-876700661
Thanks for the tests. LMK when you're ready for this to be merged!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] suddjian commented on pull request #15590: fix: avoid fetching favorite status for anonymous user
Posted by GitBox <gi...@apache.org>.
suddjian commented on pull request #15590:
URL: https://github.com/apache/superset/pull/15590#issuecomment-876648070
Thanks for the fix! I opened a PR to change the offending behavior in hydrate.js as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org