Skip to content
Snippets Groups Projects

Delete issue board welcome cookie

Merged Phil Hughes requested to merge issue-board-welcome-cookie-monster into master
All threads resolved!

What does this MR do?

This was seen in the idea to production demo, because the project had already existed on the exact same URL the cookie already existed which meant the blank state wasn't shown.

This MR deletes the cookie on project create.

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @iamphill I don't think this is the right way to solve this problem.

  • Reassigned to @iamphill

  • Phil Hughes Added 1 commit:

    Added 1 commit:

    • e66e0dff - Use a unique cookie ID to hide the issue board welcome message

    Compare with previous version

  • Phil Hughes Changed title: Delete issue board welcome cookie when project is newIssue boards unique cookie key

    Changed title: Delete issue board welcome cookie when project is newIssue boards unique cookie key

  • Phil Hughes Resolved all discussions

    Resolved all discussions

  • Author Developer

    @rspeicher I've changed it so that instead of deleting the cookie, each project will now get a unique cookie key.

  • Reassigned to @rspeicher

  • This seems overly complex now compared to just deleting the cookie when we create the project. This is a pretty minor problem that basically only affected the Idea to Production demo, and we're doing some gymnastics to accommodate it.

    Also, won't this show the issue board welcome for every user again, since the cookie we're looking for changed?

  • Author Developer

    @rspeicher If the user has lists already, it won't show it again.

    Are you suggesting I just stick to deleting the cookie? I tried it in the create method & it wasn't deleting it :confused:

  • @iamphill do you know why it wasn't deleting?

  • Author Developer

    @jschatz1 nope, but i dont know much about how Rails does cookies.

  • @iamphill it would be good to figure out why it is not working before trying to go for a different solution. :smile:

  • Author Developer

    @rspeicher @jschatz1 Think it is because the path for create is different to the path for the cookie.

    Edited by Phil Hughes
  • I agree with Jacob's note here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6899#note_17045821

    I think the latest changes are overly complex and would prefer to just delete the cookie on create. If it's not working, ask for help in #development.

  • Reassigned to @iamphill

  • Phil Hughes Added 200 commits:

    Added 200 commits:

    Compare with previous version

  • Phil Hughes Changed title: Issue boards unique cookie keyDelete issue board welcome cookie

    Changed title: Issue boards unique cookie keyDelete issue board welcome cookie

  • Author Developer

    Ok so I looked into a bit more. The reason is because when in the create method the request doesn't have the welcome hidden cookie because it is for a different path, this cookie is only available on the actual project path. :disappointed: @rspeicher

  • @iamphill I'm pretty sure you can do cookies.delete(:the_cookie_name, path: "/foo/bar/baz") from any action, can't you?

    Edited by Robert Speicher
  • Author Developer

    @rspeicher yeah I tried that & it didn't actually do anything :confused:

  • Rémy Coutable Added ~579196 label

    Added ~579196 label

  • @smcgivern This is entirely backend, can you have someone take it over?

  • Sean McGivern Added 738 commits:

    Added 738 commits:

    Compare with previous version

  • @rspeicher @iamphill I was trying to figure out what the problem was with this ... and I think it works? I rebased onto master, and there was a bug in putting the cookie on the right path, but apart from that, it looks good :slight_smile:

    Maybe someone else should test in case I've got this wrong:

    1. Create a project.
    2. Go to the issues board.
    3. Dismiss the welcome message.
    4. Refresh the page - no welcome message.
    5. Delete the project.
    6. Create the project again.
    7. Go to the issues board.
    8. The welcome message should be shown!
  • Author Developer

    @smcgivern Oh this MR works yeah. but @rspeicher about how the cookie gets deleted, instead of using the flash thing & then deleting cookie, he wanted it to be done in the create method

  • @iamphill aha, thanks. I've done that now. We can't use cookies.delete because, even though you can set a cookie for a different path, the cookies.delete method won't delete any cookies that aren't in the request, and the cookie won't be in the request because the path doesn't match: https://github.com/rails/rails/blob/v4.2.7.1/actionpack/lib/action_dispatch/middleware/cookies.rb#L327

  • Reassigned to @rspeicher

  • Sean McGivern Added 1 commit:

    Added 1 commit:

    • 996e5c1a - Delete issue board welcome cookie when project is new

    Compare with previous version

  • Phil Hughes Added 1 commit:

    Added 1 commit:

    Compare with previous version

  • Phil Hughes Added 1 commit:

    Added 1 commit:

    Compare with previous version

  • Phil Hughes Added 32 commits:

    Added 32 commits:

    Compare with previous version

  • Robert Speicher Milestone changed to %8.14

    Milestone changed to %8.14

  • Robert Speicher Status changed to merged

    Status changed to merged

  • Robert Speicher Mentioned in commit 144358e9

    Mentioned in commit 144358e9

  • 🤖 GitLab Bot 🤖 changed the description

    changed the description

  • Please register or sign in to reply
    Loading