Update documentation for getUserProfile to include information about refreshing and memoization

Description

In what follows we update a retrieved object. We then retrieve it again, but the object we get is the previous one, not the updated one. When we start a new session we get the correct value. This bug was discovered in SYNR-1161.

Environment

None

Activity

Show:
Bruce Hoff
November 21, 2017, 5:48 PM

, I see that getUserProfile() has the "@memoize" annotation. Is that the reason for the result described above? How doe "@memoize" know when a cached value is stale? Could we simply remove this annotation?

You mentioned you saw a similar phenomenon related to entity annotations. Can you repro' with the Python client and add to this issue? I do not see the "@memoize" annotation associated with annotation related code so it may be a separate issue we need to study.

Larsson Omberg
November 21, 2017, 9:18 PM
Edited

This was done by design as it is very time consuming for fetching userProfile. You can temporarily invaldiate the cache by passing in refresh=True to the function. E.g.

This is not caching but memoization so does not get invalidated automatically.

Larsson Omberg
November 21, 2017, 9:20 PM

getting annotations does not use the same logic, so is likely an unrelated issue.

Kimyen Truong
November 21, 2017, 9:33 PM

Hi Bruce and Larsson, the issue I saw was during developing the file view vignettes. After I ran synStore() to create/save a file, synSetAnnotations() fails because the file etag has changed, but wasn't reflected in the file object. The same code is in the file view vignette, but I could not reproduce the problem. I will open a different jira if it occurs again.

Bruce Hoff
November 22, 2017, 12:10 AM

I verified that the 'refresh' parameter appears in the documentation. So I guess the resolution is that Bruce needs to "RTFM".

Assignee

Bruce Hoff

Reporter

Bruce Hoff

Labels

None

Validator

None

Development Area

None

Release Version History

None

Fix versions

Priority

Major
Configure