Skip to content

Conversation

@papr
Copy link
Contributor

@papr papr commented Oct 2, 2019

No description provided.

papr added 2 commits October 1, 2019 18:30
Previously, when iterating over a filter_multiple() result crashed with a TypeError since sets are not subscriptable
@papr papr added the type: bug label Oct 2, 2019
@papr papr self-assigned this Oct 2, 2019
Fixes  #1662

- Replaces random 32bit stream with uuids
- Handle case were item was not added to storage
@papr papr requested a review from ckbaumann October 2, 2019 12:43
@papr papr marked this pull request as ready for review October 2, 2019 12:45
random.seed(string)
unique_id = StorageItem.create_new_unique_id()
random.setstate(old_state_of_random)
unique_id = str(uuid.uuid5(UUID_NAMESPACE_PUPIL_LABS, string))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why here 5 and above 4 bytes? Otherwise it looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

uuid.uuid4(): Generate a random UUID.
uuid.uuid5(namespace, name): Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a UUID) and a name (which is a string).

In one case we just need a random uuid, in the other case we need to be able to generate a reproducible uuid based on a string.

@papr papr merged commit 64a3ac4 into pupil-labs:master Oct 2, 2019
@papr papr deleted the v1.16_fixes branch March 12, 2020 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants