Skip to content
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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

remove personal votes #4616

wants to merge 8 commits into from

Conversation

mateo-ivc
Copy link
Collaborator

@mateo-ivc mateo-ivc commented Nov 8, 2024

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

  • Removed the part that queries for the votes of the user.

votes/reducer

  • Add a case that deletes locally saved votes when a new vote is created

api/event-filter

  • Remove unnecessary data from InitEvent -> older votes and votings

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • The light- and dark-theme are both supported and tested
  • The design was implemented and is responsive for all devices and screen sizes
  • The application was tested in the most commonly used browsers (e.g. Chrome, Firefox, Safari)

(Optional) Visual Changes

This comment has been minimized.

@mateo-ivc mateo-ivc self-assigned this Nov 11, 2024
@mateo-ivc mateo-ivc added the Review Needed This pull request is ready for review label Nov 11, 2024

This comment has been minimized.

Copy link
Collaborator

@Schwehn42 Schwehn42 left a 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?

})
.addCase(updatedVoting, (_state, action) => action.payload.notes?.map((n) => ({voting: action.payload.voting.id, note: n.id})))
Copy link
Collaborator

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?

Copy link
Collaborator Author

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 :)

Comment on lines 12 to 13
state.push(action.payload);
state.unshift(action.payload);
Copy link
Collaborator

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

Copy link
Collaborator

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)

Copy link
Collaborator Author

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

@Schwehn42 Schwehn42 added Changes Requested Changes requested by the reviewer and removed Review Needed This pull request is ready for review labels Nov 12, 2024
@mateo-ivc mateo-ivc added Review Needed This pull request is ready for review and removed Changes Requested Changes requested by the reviewer labels Nov 18, 2024
Copy link

The deployment to the dev cluster was successful. You can find the deployment here: https://4616.development.scrumlr.fra.ics.inovex.io
This deployment is only for testing purposes and will be deleted after 1 week.
To redeploy rerun the workflow.
DO NOT STORE IMPORTANT DATA ON THIS DEPLOYMENT

Deployed Images
  • ghcr.io/inovex/scrumlr.io/scrumlr-frontend:sha-80cc739

  • ghcr.io/inovex/scrumlr.io/scrumlr-server:sha-80cc739

Copy link

octomind-dev bot commented Nov 18, 2024

🐙 Octomind

Test Report: 7/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Failed ❌ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Failed ❌ click
create_and_delete_notes_and_actions_v2 Failed ❌ click
create lean coffee board Failed ❌ click
edit_notes_and_actions_v5 Failed ❌ click
get started Passed ✅ click
share_session Failed ❌ click
sign-in Passed ✅ click
test all ways to open the setup flow Failed ❌ click

commit sha: 80cc739

@@ -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]
Copy link
Collaborator

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

@Schwehn42 Schwehn42 added Changes Requested Changes requested by the reviewer and removed Review Needed This pull request is ready for review labels Nov 20, 2024
Copy link
Collaborator

@Schwehn42 Schwehn42 left a comment

Choose a reason for hiding this comment

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

Hi, still multiple issues here unfortunately

  1. Votes by new participants and/or new notes after a voting has concluded don't seem to apply
  2. Reloading after starting a new voting, after one has already concluded gives the result of the first voting, not the new empty one
  3. Whatever the heck this is 💀:
Screenshot 2024-11-22 at 13 40 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes Requested Changes requested by the reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants