]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/commit
Store offline data in an array rather than in a hash
authorMichal Sojka <michal.sojka@cvut.cz>
Thu, 16 Aug 2018 16:10:01 +0000 (18:10 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 16 Aug 2018 16:10:48 +0000 (18:10 +0200)
commit985405cd4345315d0502fe9e75ef879ad0c452b3
treee7e4a7e05af348900eba9ff579277e57c8bb11ef
parent945eb8aec800c9428f4507dfa8a639d7bc93f57b
Store offline data in an array rather than in a hash

This has several reasons:

1) The hash (i.e. localStorage) used timestamps as keys. When doing
   automated testing, multiple events can happen to have the same key,
   which causes problems - see the next point.

2) Events from localStorage has to be sent to the web server in the
   order of their creation. This means that before sending, we had to
   convert the hash into an array and sort it according to the
   timestamp. This can be avoided if we use an array from the
   beginning.
html/index.html