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

Allow test_track_visitor_id to be passed via headers #29

Conversation

betterzega
Copy link
Contributor

@betterzega betterzega commented Apr 28, 2017

/domain @jmileham @samandmoore @aburgel

From our conversation in the test_track channel, allowing the session to be read from the request header.

Still need to write back the test track visitor id in the response header. Should this only be passed back when the request has the TT visitor id in the header, or should it always be passed back?

Still need to do a proper integration test.

@nanda-prbot
Copy link

Needs somebody from @jmileham, @samandmoore, and @aburgel to claim domain review.

Use the shovel operator to claim, e.g.:

@myname << domain && platform

@jmileham
Copy link
Member

Should this only be passed back when the request has the TT visitor id in the header, or should it always be passed back?

I think it should only be passed back when it changes, probably? Like a X-Set-TT-Visitor-ID. It would only be set when you call test_track_visitor.log_in! or test_track_visitor.sign_up!. We might need to plumb the controller ref deeper into that DSL in order to make that work, but that seems like the right move to me.

@@ -98,6 +98,10 @@ def loaded?
!offline? && @remote_visitor.present?
end

def id_changed?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried to follow rails naming conventions, but maybe this hides what this actually represents, the fact that the visitor id was overridden by the remote visitor?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think you might want to go with a special name here. Remote won't have as much meaning to a browser of the controller mixin because to them the remote in mind is the client of the controller, not the upstream TT server, so some name that captures that the TT server changed our identity would be hot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

id_overridden_by_existing_visitor??

@betterzega
Copy link
Contributor Author

bump

subject.log_in!("identifier_type", "value")
end

expect(controller.response.headers['X-Set-TT-Visitor-ID']).to eq(nil)
Copy link
Member

Choose a reason for hiding this comment

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

not_to have_key or something?

@jmileham
Copy link
Member

<< domain tafn. Just come up with an awesome name and this is looking great.

@nanda-prbot
Copy link

@betterzega needs to incorporate feedback from @jmileham. Bump when done.

@jmileham
Copy link
Member

that'll work. it's a long enough name that it doesn't give you unwarranted confidence that you know what it's doing. domain lgtm!

@nanda-prbot
Copy link

Ready to merge! 💫 🔩 👯

@betterzega betterzega force-pushed the zega/use-header-for-test-track-visitor-id branch from df57691 to 1bc57d4 Compare May 26, 2017 16:30
@samandmoore samandmoore merged commit 7790390 into Betterment:master May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants