Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uses_versions and used_in_versions not updated bidirectionally #58

Open
rkoschmitzky opened this issue Jul 5, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@rkoschmitzky
Copy link
Contributor

Problem Statement

Updating used_in_versions should be reflected in uses_versions of the assigned collection and vise versa.

Expected Behavior

Currently, the operation is recorded properly and can be updated on the server when committing but it is not reflected within the local cache.

Context

  • OS: Any
  • Python version: 3.x
  • Trackteroid version: main
  • Ftrack Python API version: 2.5.0
  • Ftrack Server version: -

Reproducible Steps

This code can be used to reproduce the issue:

from trackteroid import *

collection1 = Query(AssetVersion).get_all(limit=1, projections=["used_in_versions", "uses_versions"])
collection2 = Query(AssetVersion).get_all(limit=1, offset=1, projections=["used_in_versions", "uses_versions"])

print(
    f"collection1 id: {collection1.id[0]}\n"
    f"collection2 id: {collection2.id[0]}\n"
    f"collection1 uses ids: {collection1.uses_versions.id}\n"
    f"collection2 used in ids: {collection2.used_in_versions.id}\n"
)
# output: 
# collection1 id: 029a25ce-8b60-11eb-bdb7-c2ffbce28b68
# collection2 id: 082158fc-6591-11ed-a73a-92ba0fc0dc3d
# collection1 uses ids: ['1fe0e8ae-6596-11ed-a73a-92ba0fc0dc3d']
# collection2 used in ids: EmptyCollection[AssetVersion]

collection1.uses_versions = collection2

print(
    f"collection1 id: {collection1.id[0]}\n"
    f"collection2 id: {collection2.id[0]}\n"
    f"collection1 uses ids: {collection1.uses_versions.id}\n"
    f"collection2 used in ids: {collection2.used_in_versions.id}\n"
)
# output: 
# collection1 id: 029a25ce-8b60-11eb-bdb7-c2ffbce28b68
# collection2 id: 082158fc-6591-11ed-a73a-92ba0fc0dc3d
# collection1 uses ids: ['082158fc-6591-11ed-a73a-92ba0fc0dc3d']
# collection2 used in ids: EmptyCollection[AssetVersion]

Workaround

To work with properly reflected data committing and re-querying should reflect the attribute changes.

@rkoschmitzky rkoschmitzky added the bug Something isn't working label Jul 5, 2023
@rkoschmitzky rkoschmitzky changed the title _uses_versions_ and _used_in_versions_ not updated bidirectionally uses_versions and used_in_versions not updated bidirectionally Jul 5, 2023
@rkoschmitzky
Copy link
Contributor Author

might be a similar problem as described in #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant