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

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

Closed
bjester opened this issue Jul 6, 2023 · 6 comments · Fixed by #4632
Closed

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

bjester opened this issue Jul 6, 2023 · 6 comments · Fixed by #4632
Assignees
Labels
DEV: backend P1 - important Priority: High impact on UX

Comments

@bjester
Copy link
Member

bjester commented Jul 6, 2023

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

@bjester bjester added the P0 - critical Priority: Release blocker or regression label Jul 6, 2023
@bjester bjester added this to the Studio: upcoming patches milestone Jul 6, 2023
@bjester bjester changed the title Unpublished change query can pickup non-user changes Unpublished change query can pickup changes originating from the backend Jul 6, 2023
@vkWeb vkWeb self-assigned this Jul 7, 2023
@vkWeb
Copy link
Member

vkWeb commented Jul 7, 2023

@bjester any ideas on reproducing this behaviour locally?

@bjester
Copy link
Member Author

bjester commented Jul 7, 2023

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.

@bjester bjester added P1 - important Priority: High impact on UX and removed P0 - critical Priority: Release blocker or regression labels Sep 7, 2023
@vkWeb vkWeb removed their assignment Nov 1, 2023
@vkWeb
Copy link
Member

vkWeb commented Nov 1, 2023

Unassigning myself until more clarity is obtained on this issue.

@bjester bjester self-assigned this Nov 7, 2023
@V0YD23
Copy link

V0YD23 commented Dec 10, 2023

@bjester @MisRob can i work on this issue ?

@MisRob
Copy link
Member

MisRob commented Dec 13, 2023

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

@rtibbles
Copy link
Member

rtibbles commented Aug 8, 2024

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
Labels
DEV: backend P1 - important Priority: High impact on UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants