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

With Elemental a page level save & publish fails to represent element update (inline edits only) #50

Open
NightJar opened this issue Apr 14, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@NightJar
Copy link

NightJar commented Apr 14, 2021

This is for inline editable elements only, in combination with an immediate publish action (not save, then publish - thus does not affect 'separate screen' element editing).

A new version entry is created, but lists the wrong author (see #51), and fails to show that an element was altered as part of the snapshot. An auditor is left with an entry containing no edits, and an invalid attribution.

Recreation

  • Create a new project with snapshot admin & elemental - apply elemental to pages & create/edit templates as appropriate
  • Create secondary user, e.g. "Editor" in the "Content Authors" group
  • admin/pages/edit/show/2, add a Content element.
  • Open content element and add text
  • click Save & Publish on the Page.
  • 👀 History tab lists Element creation & Publish event.
  • Sign in as Default Admin
  • admin/pages/edit/show/2, and edit the Content element
  • click Save & Publish on the Page.
  • 👀 History tab lists only Element creation, and Publish even x2. No Element edit is logged.

image
"Editor" adds & edits content element

image
"Default Admin" edits content element

image
Applies to inline editing only

Notes on other "workflows"

Non-inline element edit (e.g. userform), page level publish

This is a natural two part process and does not manifest the issue, as the separate save step creates a snapshot entry.

Individual element save, page level publish

Does not manifest the issue, as it is a two step process as above with non-inline editing

Individual element publish

Does not manifest the issue. Could not replicate with inline editing as an error seemed to occur. Cannot manifest with non-inline editing either, as the save & publish action creates a single workflow entry at that point, as does saving (& publishing at page level).

Untested

I have not tried any further usage paths such as publishing via campaigns.

@NightJar NightJar added the bug Something isn't working label Apr 14, 2021
@unclecheese
Copy link

Having a hard time reproducing this one. Could use more details or a screenshot.

@NightJar NightJar changed the title With Elemental a page level save & publish shows the wrong author & fails to represent element update With Elemental a page level save & publish fails to represent element update (inline edits only) Apr 19, 2021
@NightJar
Copy link
Author

I have split the incorrect author name as I believe this is separate (can reproduce without Elemental)

@NightJar
Copy link
Author

I have updated the OP with recreation details :)

@unclecheese
Copy link

unclecheese commented Apr 20, 2021

I'm pretty sure this is the expected result. From what I can tell, you don't need separate users to replicate this issue. What's happening here is just highlighting the difference between publishing element changes on page save versus from with in the elemental editor. These are always going to be separate events.

Snapshots tracks user actions, not database mutations. This is because, fundamentally, the snapshots module is just a timestamp provider, so tracking multiple mutations in the same user action is something we've tried to avoid.

For clarity:

  • When the element is created as "Untitled content block" in the editor, you now have a snapshot entry for "Created block", regardless of which user does it.
  • When you change the content in the block, you have two options for commiting that change:
    • Save block inline -> New snapshot for "modified block" because this represents a change in owned content.
    • Save block implicitly by saving page -> New snapshot for "published page", because that was the event that happened. The details of what changed in that publish are not meant to be relevant.

Of course, it is true that in that publish, a block was modified, but the block is treated as page content. You can also modify the title of the page, hit publish, and you don't get a "modified page" entry. You just get "publish."

If content blocks were created lazily, e.g. "add new" just created an entry in the UI and not in the database, then we wouldn't expect to see anything in the snapshot table for that event, but because that add event represents something new being added to the ownership graph (albeit "empty"), we get a new snapshot.

@unclecheese
Copy link

Incorrect author issue should be resolved by: a06a95f

@NightJar
Copy link
Author

NightJar commented May 3, 2021

The incorrect author issue is resolved with a06a95f - but that is #51, not this issue :)

@NightJar
Copy link
Author

NightJar commented May 4, 2021

Sorry, missed the earlier comment. I'm happy with that, I was thinking about what you've explained previously too. I guess although the technical differences are apparent, the immediate differences to a user may not be... it becomes far more to the domain of UX rather than "computational deficiency".

I guess the outstanding question I have that might turn this around again is:
Given I edit a content block inline and immediately publish the page, it is expected that the single action of editing the page is captured (and not the block edit, as this was not a separate user action)...
If I think check the history of that block, will it show its individual edit at that point as part of the larger page edit?
Or since it was not a user action, will the entry be missed?
And if it is true that it is shown as I believe it should be, how can a user reconcile the mis-match of logged info from the "umbrella" page level history screen?

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

2 participants