-
Notifications
You must be signed in to change notification settings - Fork 24
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 rare crash when viewing shared annotation #6892
Conversation
…e in the first place if it's not allowed
…-crash-in-shared-annotation
…e (not necessary anymore since we ditched Flow)
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.
Thanks for fixing this bug 🚫 🐛 .
Everything works and the code looks fine besides a small thing you might have missed (see my comment). After you resolved this, it should be ready to be merged 👯
import type { OxalisState } from "oxalis/store"; | ||
|
||
export function mayEditAnnotationProperties(state: OxalisState) { | ||
const { owner, restrictions } = state.tracing; | ||
const activeUser = state.activeUser; | ||
|
||
return !!( | ||
restrictions.allowUpdate && | ||
restrictions.allowSave && | ||
activeUser && | ||
owner?.id === activeUser.id | ||
); | ||
} |
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.
🎉
…alized_format * 'master' of github.com:scalableminds/webknossos: Fix rare crash when viewing shared annotation (#6892)
…come_header_UI * 'master' of github.com:scalableminds/webknossos: Fix rare crash when viewing shared annotation (#6892)
…pdown-menu * 'master' of github.com:scalableminds/webknossos: Avoid SQL error when fetching view config for zero-layer dataset (#6912) Fix date formatting for VX reports (#6908) Fix rare crash when viewing shared annotation (#6892) Slim down view mode dropdown by using icons (#6900) Logging on password reset/change (#6901) When merging volume tracings, also merge segment lists (#6882) avoid spinner when switching tabs in dashboard (#6894)
If a user (who is not the owner) views a shared annotation, editing the layer settings will cause failed edit-annotation requests. After several retries (will take 5 minutes and new edits will reset the timer), the sagas will crash since the user is not allowed to edit annotation properties (only the tracings itself may be changed).
The PR fixes this by:
URL of deployed dev instance (used for testing):
Steps to test:
Issues:
(Please delete unneeded items, merge only when none are left open)