Delete issue board welcome cookie
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.
Merge request reports
Activity
Reassigned to @rspeicher
@rspeicher giving this to you to hit.
- Resolved by Phil Hughes
@iamphill I don't think this is the right way to solve this problem.
Reassigned to @iamphill
Added 1 commit:
- e66e0dff - Use a unique cookie ID to hide the issue board welcome message
@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?
@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
@iamphill do you know why it wasn't deleting?
@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.
@rspeicher @jschatz1 Think it is because the path for
create
is different to the path for the cookie.Edited by Phil HughesI 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
Added 200 commits:
-
e66e0dff...eb541b4f - 199 commits from branch
master
- a23a224c - Delete issue board welcome cookie when project is new
-
e66e0dff...eb541b4f - 199 commits from branch
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. @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@rspeicher yeah I tried that & it didn't actually do anything
@smcgivern This is entirely backend, can you have someone take it over?
Added 738 commits:
-
a23a224c...20a7db44 - 737 commits from branch
master
- da4f9684 - Delete issue board welcome cookie when project is new
-
a23a224c...20a7db44 - 737 commits from branch
@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
Maybe someone else should test in case I've got this wrong:
- Create a project.
- Go to the issues board.
- Dismiss the welcome message.
- Refresh the page - no welcome message.
- Delete the project.
- Create the project again.
- Go to the issues board.
- The welcome message should be shown!
@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 thecreate
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, thecookies.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#L327Reassigned to @rspeicher
Added 1 commit:
- 996e5c1a - Delete issue board welcome cookie when project is new
Added 32 commits:
-
79f56cd7...4fd01518 - 30 commits from branch
master
- a2e9bc35 - Delete issue board welcome cookie when project is new
- 07e4ffd7 - Fixed boards store spec
-
79f56cd7...4fd01518 - 30 commits from branch
Milestone changed to %8.14
Mentioned in commit 144358e9
Thanks @iamphill @smcgivern!
added Category:Team Planning label