mozilla/browserid — pull request #1612 by shane-tomlinson (2012-05-18 12:05:19+00:00)
Title: Issue 1597 interaction data

@jedp - Mind reviewing this one?

I did a serious yak shave, but I feel like the data model that is saved to localStorage is easier to understand. I moved the localStorage component from storage.js into shared/models/interaction_data.js, hopefully simplifying as I went along. Tests were beefed up to make sure we weren't clobbering any current data when we publish staged data.

We must wait until session_context to start writing data into localStorage because this is the first point at which we know whether the current session is allowed to publish collected data. Because we only know whether we are allowed to publish a session's data once session_context completes, I kept the initial set of the timestamp, screen size, etc where it was.

If a session's session_context never returns, data for the session will not be saved - this is an acceptable data loss for user data privacy.