question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Apostrophe versions] authorId and author fields is null for aposDocVersions

See original GitHub issue

To Reproduce

Step by step instructions to reproduce the behavior:

  1. Download and install the Apostrophe Open Museum project from: https://github.com/apostrophecms/apostrophe-open-museum
  1. Add various content types from the back end modal using the open museum project.
  1. Edit any content type and click on More/Versions:
  1. Few versions are missing the user title and instead of displaying the message: _ admin made changes on DD/MM/YYYY_ it display as: made changes on DD/MM/YYYY

Expected behavior

The user title should always be displayed for each content type in the versions modal as only logged in users should be allowed to edit and make changes to the back end content using the modal

Describe the bug

The authorId and author fields are not always saved as the current logged in user and in many instances they are instead saved as null in the aposDocVersions collection for many documents:

image

Details

Version of Node.js: v12.14.0

Server Operating System: Linux (Ubuntu 18x) while no Docker is installed

Additional context:

The same issue can be replicated across different browsers and different devices (OS)

Screenshots

image

Mongo DB Dump

This DB dump shows all aposDocVersions documents where the authorId and author fields is null for out of the box Git Hub Apostrophe boiler plate installation and no extra configuration. So far there are about 20 reported entries while in some other Prod sites the number of authorId and author fields null records can reach +200k entries.

Also this dump has more recent entries than the one showed in the screen shot.

Attached:

mongodb.zip

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boutellcommented, Jul 14, 2020

Changing all the calls to getReq would be a big task, but changing getReq to include a title for its simulated user object would make a great PR. getAnonReq could return a different title.

On Tue, Jul 14, 2020 at 12:39 PM Omar notifications@github.com wrote:

Okay thanks for the update though don’t you think that as version log it should show all users making any changes to the back end content? These users don’t have to be always logged in users but they can be 3rd party APIs or command line tasks

I think it would be much much better user experience that if no actual user is present in the context it would default to the name of the task that created that content so per say it could be (command line task, API request…etc) and that could be overridden on project level code to include any custom name and that would only be the case as well if there was no actual user object

Also back end users will never know why the user title was missing besides this would be very good thing to narrow down the scope of the issue as I can’t tell now for sure if this is a bug or it is just code improvement/tweak?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/2243#issuecomment-658286166, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27IRFDJ23R6GLUHXF6TR3SC4ZANCNFSM4OY24CTA .

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

1reaction
okfmohamedcommented, Jul 14, 2020

Okay thanks for the update though don’t you think that as version log it should show all users making any changes to the back end content? These users don’t have to be always logged in users but they can be 3rd party APIs or command line tasks

I think it would be much much better user experience that if no actual user is present in the context it would default to the name of the task that created that content so per say it could be (command line task, API request…etc) and that could be overridden on project level code to include any custom name and that would only be the case as well if there was no actual user object

Also back end users will never know why the user title was missing besides this would be very good thing to narrow down the scope of the issue as I can’t tell now for sure if this is a bug or it is just code improvement/tweak?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scribble: The Racket Documentation Tool - Download Racket
a document—aside from scribble/manual adding a version number—but it ... Generates a paragraph with style name 'author to show the author(s) of a...
Read more >
Practical Experience Applying Formal Methods to Air Traffic ...
are unreleased preliminary versions that are still under. development by the FormalWARE project. ... authors for readability, and is not a style imposed...
Read more >
Professional PHP Programming
About the Authors. Jesus M. Castagnetto. Jesus M. Castagnetto is a Ph.D. Chemist currently working at The Scripps Research. Institute as a Postdoctoral ......
Read more >
https://grants.nih.gov/grants/ElectronicReceipt/fi...
Version Number, Revision Date, Author, Summary of Changes ... Shared validations: Validations for fields that are common to multiple forms and uses the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found