-
Notifications
You must be signed in to change notification settings - Fork 58
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
remove personal votes #4616
base: main
Are you sure you want to change the base?
remove personal votes #4616
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Do you still have plans to change the backend so only the most recent voting is sent or should we just leave it as is for now?
src/store/features/votes/reducer.ts
Outdated
}) | ||
.addCase(updatedVoting, (_state, action) => action.payload.notes?.map((n) => ({voting: action.payload.voting.id, note: n.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.
we added this during bug hunting, but is it actually still relevant?
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.
Good eye👀, I had forgotten about that, removed it :)
src/store/features/votes/reducer.ts
Outdated
state.push(action.payload); | ||
state.unshift(action.payload); |
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.
looking at it now, I think I prefer pushing over unshifting and taking the last element instead of the first in the relevant code. Just to be in line with the other reducers
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.
(only if you don't plan on changing the backend though, because it wouldn't matter otherwise)
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 changed it back and implemented filters so that only the most recent votes and voting in the InitEvent are sent
The deployment to the dev cluster was successful. You can find the deployment here: https://4616.development.scrumlr.fra.ics.inovex.io Deployed Images
|
🐙 OctomindTest Report: 7/14 successful.
commit sha: 80cc739 |
server/src/api/event_filter.go
Outdated
@@ -312,6 +311,18 @@ func (boardSubscription *BoardSubscription) eventFilter(event *realtime.BoardEve | |||
|
|||
func eventInitFilter(event InitEvent, clientID uuid.UUID) InitEvent { | |||
isMod := isModerator(clientID, event.Data.BoardSessions) | |||
latestVoting := event.Data.Votings[0] |
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.
this leads to an error on a new board which has no votings yet:
2024-11-20T12:26:03.515343879Z panic: runtime error: index out of range [0] with length 0
2024-11-20T12:26:03.515345713Z
2024-11-20T12:26:03.515346963Z -> scrumlr.io/server/api.eventInitFilter
2024-11-20T12:26:03.515348546Z -> /go/src/github.com/inovex/scrumlr.io/api/event_filter.go:314
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.
Description
The problem was that if a user re-joins the board during a vote, they lose all votes except their own.
The reason for this is that the
Fullboard
method only queries the votes that the user has created.Changelog
boards/boards.go
votes/reducer
api/event-filter
Checklist
(Optional) Visual Changes