Skip to content

Unpublished change query can pickup changes originating from the backend #4202

Closed

Description

@bjester

Observed behavior

A channel was showing as publishable even though it had no new changes. We need to enforce that created_by is set more often, so _unpublished_changes_query can't rely on that for filtering out changes which simply need to be returned from the backend and do not influence the status.

chs = Change.objects.filter(channel_id='22fd1359d8d75ff1b0cad8e401a08f16').values_list('created_by_id', 'table', 'change_type', 'applied', 'errored', 'kwargs').order_by('-server_rev')[:10]
>>> 
>>> for ch in chs:
...     print(ch)
... 
(7035, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'version': 4, 'modified': '2023-07-06T19:08:47.832214Z'}})
(7035, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'publishing': False, 'last_published': '2023-07-06T19:08:47.467597Z'}})
(None, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'__TASK_ID': None}})
(None, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'published': True, 'publishing': False, 'primary_token': 'tugofranod', 'last_published': '2023-07-06T19:08:47.467597Z', 'unpublished_changes': True}})
(7035, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'publishing': True}})
(None, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'__TASK_ID': 'bdf2e408301a446dab7abb4105ce4c06'}})
(7035, 'channel', 6, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'language': 'en', 'version_notes': 'updated video resolution'})

Expected behavior

The _unpublished_changes_query produces the correct output for when there are actual publishable changes.

User-facing consequences

Confusion regarding what changes haven't been published

Activity

  1. changed the title [-]Unpublished change query can pickup non-user changes[/-] [+]Unpublished change query can pickup changes originating from the backend[/+] on Jul 6, 2023
  2. self-assigned this
    on Jul 7, 2023
  3. vkWeb commented on Jul 7, 2023

    @vkWeb
    Contributor

    @bjester any ideas on reproducing this behaviour locally?

  4. bjester commented on Jul 7, 2023

    @bjester
    MemberAuthor

    Following the order of the change events listed should hopefully reproduce it. But either way, the issue is this change event which satisfies the query's filtering:

    (7035, 'channel', 2, True, False, {'key': '22fd1359d8d75ff1b0cad8e401a08f16', 'mods': {'publishing': False, 'last_published': '2023-07-06T19:08:47.467597Z'}})

    We need to re-think how we approach this.

  5. added and removed
    P0 - criticalPriority: Release blocker or regression
    on Sep 7, 2023
  6. removed their assignment
    on Nov 1, 2023
  7. vkWeb commented on Nov 1, 2023

    @vkWeb
    Contributor

    Unassigning myself until more clarity is obtained on this issue.

  8. self-assigned this
    on Nov 7, 2023
  9. 0xV0YD commented on Dec 10, 2023

    @0xV0YD

    @bjester @MisRob can i work on this issue ?

  10. MisRob commented on Dec 13, 2023

    @MisRob
    Member

    Hi @yash1378, thank you, this is already assigned to a team member

  11. assigned and unassigned on Aug 8, 2024
  12. rtibbles commented on Aug 8, 2024

    @rtibbles
    Member

    Ultimately, I think this comes back down to our Change objects serving a dual purpose, as a message queue for real time updates, and as a change event log for channel edits.

    Ideally, we would only record change events for the latter, but until we implement a separate mechanism for a real time message queue (using websockets), it is still serving this dual purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions