Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Syncing an object without a prop/link set alongside an object with it set fetches it #886

Copy link
Copy link

Description

@dnwpark
Issue body actions

Given a schema:

type A {
    val: int64;
};

the following code:

original = default.A(val=1)
self.client.save(original)

mirror_1 = self.client.query_required_single(
    default.A.select(val=False).limit(1)
)
mirror_2 = self.client.query_required_single(
    default.A.select(val=True).limit(1)
)

original.val = 2
self.client.save(original)
self.client.sync(mirror_1, mirror_2)

assert not hasattr(mirror_1, "val")  # fail

will fail the assertion

see #872 test test_model_sync_single_prop_06 and test_model_sync_multi_prop_08 for props
see #881 test test_model_sync_single_link_04

Notably, multi-links will not fetch the values when synced with an object with it set, but will if that object had its set value changed:

original = default.A(val=1)
self.client.save(original)

mirror_1 = self.client.query_required_single(
    default.A.select(val=False).limit(1)
)
mirror_2 = self.client.query_required_single(
    default.A.select(val=True).limit(1)
)

mirror_2.targets = changed_targets_2
self.client.sync(mirror_1, mirror_2)

assert mirror_1.targets._items == []  # fail

see #881 test test_model_sync_multi_link_10

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    ORMbugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.