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

Activity Log: Published Activity is not appearing for a Content Item #2377

Closed
zcolah opened this issue Dec 4, 2023 · 10 comments · Fixed by #2570
Closed

Activity Log: Published Activity is not appearing for a Content Item #2377

zcolah opened this issue Dec 4, 2023 · 10 comments · Fixed by #2570
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@zcolah
Copy link

zcolah commented Dec 4, 2023

Describe the bug
I have published an article multiple times over the last 14 days in the Zesty 2022 Marketing Instance. I wanted to review the activity log today for this item and noticed that there were 0 publish logs. I am not sure why this is the case because this article is live which means it should have at least 1 publish present and I know for sure I have edit it, saved it and published it multiple times after that as well.

One key observation @theofficialnar and I made was that the Scheduled for Publish action does appear despite the Published action not appearing.

This is a very important issue to look into as it concerns multiple key customers of ours who need this feature to be working perfectly.

Content Item Link:
https://8-aaeffee09b-7w6v22.manager.zesty.io/content/6-45a908-qfw88c/7-a4f6c6bdc5-kkztvh/

Activity Log Link:
https://8-aaeffee09b-7w6v22.manager.zesty.io/reports/activity-log/resources/7-a4f6c6bdc5-kkztvh?from=2023-11-04&to=2023-12-04&action=4

Screenshot:
CleanShot 2023-12-04 at 14 46 08

@zcolah zcolah added the bug Something isn't working label Dec 4, 2023
@finnar-bin
Copy link
Contributor

finnar-bin commented Dec 5, 2023

@markelmad need your input on this, I tried checking and whenever a content item is published now, despite the request payload being correct it is being tagged as a "Scheduled publish" on activity log.
image

As per my checking, on the frontend we differentiate publish types by checking if the word "scheduled" exists on the action.meta.message from the response of /audits. Reference: https://github.com/zesty-io/manager-ui/blob/1fd5f14aa1ecb9d5391b519b995c290d80b6670a/src/shell/services/instance.ts#L132C11-L136C31

The code above was never changed and was last touched 16 months ago that's why I am wondering if there were any changes made to how the action.meta.message is generated since right now, the message says "Published Item XXXX-ZUID-XXXX scheduled for 2023-12-06T05:05:08Z" even if I did a Publish now and not a scheduled publish making us not have a way to distinguish the 2 publish types.

@zcolah
Copy link
Author

zcolah commented Dec 5, 2023

@theofficialnar I am potentially wondering if this is tied to the Content Title Bar update we made as our Publish button also acts as a schedule button in one use case. @agalin920 any thoughts on the same?

@finnar-bin
Copy link
Contributor

@zcolah when I checked the request payload it is still being sent as publishAt: "now" when clicking the publish button which I'm assuming is the expected behavior when doing a non-scheduled publish. But correct me if I'm wrong @agalin920 and @markelmad .

@finnar-bin finnar-bin added the question Further information is requested label Dec 6, 2023
@finnar-bin
Copy link
Contributor

@markelmad just wanted to follow up on this.

@zcolah
Copy link
Author

zcolah commented Dec 21, 2023

@markelmad @theofficialnar I got some more context from @shrunyan on this issue. Apparently no content item ever gets a published action. If the item gets published, it always gets a scheduled action instead.

@finnar-bin
Copy link
Contributor

@zcolah so if that's the case then wouldn't that mean this bug has been there since activity log was made? Now I'm wondering how we can differentiate a publish now from a scheduled publish in the activity log, wouldn't it make sense to just remove the "Published" action filter?

@markelmad
Copy link

@theofficialnar The Audit log always has a message with the word 'scheduled' on it whether it is being published now or scheduled. Since you mentioned you only check for existing 'scheduled' strings from the message, I guess the fix could be done on how the message is constructed within the audit logging. I'll dig deeper into this and see if we really need to have the fix within the audit part or it could be within the publishing part (which would be more tedious work). I'll give updates once I have some answers. ANd I believe we should not remove the 'Published' action filter.

@theofficialnar you are using 'scheduled' keyword and 'published' keyword for this to distinguish?

@finnar-bin
Copy link
Contributor

@markelmad Currently it only checks if the word "scheduled" is present on action.meta.message to determine if it's a publish now or a scheduled action.

@zcolah
Copy link
Author

zcolah commented Jan 16, 2024

@markelmad @theofficialnar @shrunyan @ardeay Would love to hear your thoughts on what I have written down below.

I have an idea for the situation where we make no changes to the back-end where "both schedule and publish actions are marked as scheduled".

What if on the front end we write some logic where we display:

1. Published Action: If the schedule action was within the same minute as the scheduled for time
2. Scheduled Action: If the schedule action was more than a minute before the scheduled for time (technically this would be an else statement, not if).

This helps with the data integrity issue as the user is now aware of when the item was published vs scheduled.

There is one drawback to this solution
These changes would not appear on the PDF report that is generated as that would still be relying on the back end API. Of course we can write similar logic and make similar changes for the PDF report generation system as well.

I would recommend we do this for displaying all of the past actions. This way no update needs to be made to the database.

I do recommend we investigate a much better long term solution for future actions, so we do not need to do this workaround. In the long term ideally, when the user clicks on the publish button, a publish action should be logged in the back end, and when the user clicks on the schedule button, a schedule action should be logged in the back end.

@finnar-bin
Copy link
Contributor

finnar-bin commented Feb 27, 2024

@markelmad is there any particular reason why recently the logs response seem to have changed?

I found a publish action log dated Nov 30, 2022 which has 2 publish actions log both created at the same time, one says scheduled while the other just says published.
image

But currently whenever a user publishes something either via publish now or scheduled publish it now only returns one log which always says "scheduled" even if it was not scheduled.
image

In the meantime, a quick fix as suggested by @agalin920 which is to check if the createdAt/happenedAt log is the same as the datetime on the action message, it would be treated as a "Published" action has been created (#2570) but a long term fix would be probably be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Status: Recently Completed
Development

Successfully merging a pull request may close this issue.

3 participants