Roundup Tracker - Issues

Issue 2551034

classification
Title: REST etag ordering
Type: behavior Severity: normal
Components: Infrastructure Versions: devel
process
Status: fixed Resolution: fixed
Dependencies: Superseder:
Assigned To: rouilj Nosy List: joseph_myers, rouilj
Priority: normal Keywords: rest

Created on 2019-03-19 00:26 by joseph_myers, last changed 2019-05-25 03:26 by rouilj.

Messages
msg6403 Author: [hidden] (joseph_myers) Date: 2019-03-19 00:26
The REST etag generation uses node.items(protected=True).  The order in
which properties appear in the result of node.items() is not necessarily
deterministic; it ends up depending on the ordering of dict keys, and
only in more recent Python 3 versions is dict guaranteed to preserve
insertion order.

I think sorting the result of items() should suffice to address this
issue (so repr(sorted(items)) (untested)).
msg6419 Author: [hidden] (rouilj) Date: 2019-03-23 04:17
Used sorted(items) as suggested and was able to restart the roundup
server under both python3 and python2 and get the same etag for an issue.

The etag would change on every server restart before.

I can't figure out how to test this though. I can't set the creation and
activity dates when creating the test case. Hence the etag is always
different since the data is different.
msg6484 Author: [hidden] (rouilj) Date: 2019-05-25 03:26
Figured out how to test by hijacking the date.Date function
in the test.

rev5727:8b5171f353eb

has the patch for this.

Closing.
History
Date User Action Args
2019-05-25 03:26:04rouiljsetkeywords: + rest
status: open -> fixed
resolution: fixed
messages: + msg6484
2019-03-23 04:17:11rouiljsetstatus: new -> open
assignee: rouilj
messages: + msg6419
nosy: + rouilj
2019-03-19 00:26:39joseph_myerscreate