naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.08k stars 326 forks source link

Google Brews show no author(s) in metadata #1219

Closed G-Ambatte closed 1 year ago

G-Ambatte commented 3 years ago

Brews that are stored in Google Drive do not show any author information in the file metadata on the /edit page.

Reproduction steps:

  1. Open the /edit page of any brew stored on Homebrewery
  2. Check the metadata and confirm the author information exists
  3. Switch to Google Drive, confirm move
  4. Refresh the page
  5. Check the metadata, author information is no longer shown

The reverse also holds true: removing a brew from Google to Homebrewery will cause the author information to be shown.

G-Ambatte commented 3 years ago

A quick perusal of googleActions.js shows that the term authors only shows up on three lines: 125, 245, and 299 (on my local copy, apologies if I've edited this and changed the line numbers slightly).

125: authors : [req.account.username], //TODO: properly save and load authors to google drive - listGoogleBrews() 245: authors : [], - in newGoogleBrew() 299: authors : [], - in readFileMetadata()

So it appears that the author information isn't actually being written to or read from Google. However it seems should be fairly simple to correct, as systems is also an array that gets saved to/read from Google, so it may just be a case of duplicating how systems is handled.

Gazook89 commented 2 years ago

I don't believe this is an issue anymore, after the work on the stubs likely. I followed your steps to reproduce and didn't get the same error on a few brews. And now authors are stored in stubs, not on gdrive at all.

@G-Ambatte, confirm and then this can be closed out.

G-Ambatte commented 1 year ago

I'll test it today, but I suspect that there's still an issue here, based on this line of code.

G-Ambatte commented 1 year ago

Looks like it's working, I suspect that authors being an empty list in the object returned GoogleActions.js is a non-issue because authors is handled in the stub which is stored locally in MongoDB.

image