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

Unable to save brew #1250

Closed
G-Ambatte opened this issue Feb 20, 2021 · 7 comments
Closed

Unable to save brew #1250

G-Ambatte opened this issue Feb 20, 2021 · 7 comments

Comments

@G-Ambatte
Copy link
Collaborator

G-Ambatte commented Feb 20, 2021

Reproduction steps:

  1. Navigate to homebrewery.naturalcrit.com/new
  2. Paste the Markdown below.
  3. Hit 'Save'
  4. Brew is not saved, do not get redirected to the edit page

Amelioration steps:

  1. Open Properties tab
  2. Manually enter a Title
  3. Hit Save
  4. Brew is saved, get redirected to edit page

<style>
  .phb {
    width: 500px;
    height: auto;
  }

  .phb#p1:after { 
  display:none;
  }

  .centered {
    width: 90%;
    margin: auto;
    display: block;
  } 
</style>

<div class='wide'>
<!-- Item Name -->
### Fiendmask

<!-- Image of the Item -->
<img src='https://i.imgur.com/94oM1ts.png' class="centered" style='mix-blend-mode:multiply'/>

<!-- Credit for Image of Item -->
<div class="centered">

</div>

<!-- Item Description -->
*
  A mask made from the skull of the devil who's essence is giving it its powers. Its name "Retifer" stands carved in Infernal upon     the brows.
*
  >**Stats**
> 
> +1 DEX
>
> +5 Initiative
  
#### Abilities
  
  <br>

  **Malevolent Presence** If you wear this mask you gain Advantage on Intimidation checks.  
  
**Devil's Sight**. Magical Darkness doesn't impede your vision.
  
  **Retifer's Price** You can choose to spend 10% of your current HP, rounded up, to add 1d6 + your character's level fire, cold or necrotic damage.

</div>
@G-Ambatte
Copy link
Collaborator Author

G-Ambatte commented Feb 20, 2021

Just to further muddy the waters, following the reproduction steps on my local Win10 HB install (v2.10.7) results in a Brew with the title: * A mask made from the skull of the devil who's essence is giving it its powers. Its name "Retifer" stands carved in Infernal upon the brows. *
Based on the investigation that I have completed with the Marked.js demo and it's raw Lexer output, this appears to be the correct title for this source Markdown.


Following the reproduction steps on my FreeBSD HB install (v2.10.6) produces a brew with the title Fiendmask.

@G-Ambatte
Copy link
Collaborator Author

On further investigation, it looks like my local Win10 install was not signed into a Google account. Testing with it signed in resulted in the following error messages:


OAuth2Client {
_events: [Object: null prototype] { tokens: [Function (anonymous)] },
_eventsCount: 1,
_maxListeners: undefined,
transporter: DefaultTransporter {},
credentials: {
access_token: undefined,
refresh_token: '1//0gkvJF7pHeCMmCgYIARAAGBASNwF-L9Irm0KcuY_i4IzHIvL7rS8U31WKTT4gUDUvUSqIuqekuZFoTsSepQvzFLfX7gccnslwZP8'
},
certificateCache: {},
certificateExpiry: null,
certificateCacheFormat: 'PEM',
refreshTokenPromises: Map(0) {},
_clientId: '298979587138-hvhbddolumnae02ckmetordv6ncq3kcq.apps.googleusercontent.com',
_clientSecret: 'w98ie9v0Ot98RsQCOV1qCOkW',
redirectUri: '/auth/google/redirect',
eagerRefreshThresholdMillis: 300000,
forceRefreshOnFailure: false,
[Symbol(kCapture)]: false
}
GaxiosError: Properties and app properties are limited to 124 bytes in UTF-8 encoding, counting both the key and the value.
at Gaxios._request (D:\Homebrewery\homebrewery\node_modules\gaxios\build\src\gaxios.js:112:23)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async OAuth2Client.requestAsync (D:\Homebrewery\homebrewery\node_modules\google-auth-library\build\src\auth\oauth2client.js:343:18)
at async Object.newGoogleBrew (D:\Homebrewery\homebrewery\server\googleActions.js:198:15)
at async newGoogleBrew (D:\Homebrewery\homebrewery\server\homebrew.api.js:127:18) {
response: {
config: {
url: 'https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart',
method: 'POST',
userAgentDirectives: [Array],
paramsSerializer: [Function (anonymous)],
data: [PassThrough],
headers: [Object],
params: [Object],
validateStatus: [Function (anonymous)],
retry: true,
body: [PassThrough],
responseType: 'json',
retryConfig: [Object]
},
data: { error: [Object] },
headers: {
'alt-svc': 'h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"',
connection: 'close',
'content-length': '386',
'content-type': 'application/json; charset=UTF-8',
date: 'Sat, 20 Feb 2021 20:25:02 GMT',
server: 'UploadServer',
vary: 'Origin, X-Origin',
'x-guploader-uploadid': 'ABg5-Uy45-Hvfk9au36GcdB5xmNWnP__cMlc8Kx_p4QLj37-EYMPkRqbLDSk77U69wSNSDiGzTaNjOKMGqRffJOI96M'
},
status: 403,
statusText: 'Forbidden',
request: {
responseURL: 'https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart'
}
},
config: {
url: 'https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart',
method: 'POST',
userAgentDirectives: [ [Object] ],
paramsSerializer: [Function (anonymous)],
data: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_flush: [Function: flush],
[Symbol(kCapture)]: false,
[Symbol(kTransformState)]: [Object]
},
headers: {
'x-goog-api-client': 'gdcl/4.4.3 gl-node/14.15.1 auth/6.1.6',
'content-type': 'multipart/related; boundary=62496146-3fa2-435a-b9f7-6eae07804f01',
'Accept-Encoding': 'gzip',
'User-Agent': 'google-api-nodejs-client/4.4.3 (gzip)',
Authorization: 'Bearer ya29.A0AfH6SMCldoc_Lo5O_PnsdI_usZTDIzBy_qhKd4ADGJPqewDbryaSDff2rl0bM8wPDBmudTi7Gte-oY3FqyGHjZlcokrg9JiPoqB8y3XlyK3O_l7hKPmTQ-XuMUausE0PgUMVb8A4cR4RocY0tB1xk81Zj_4-',
Accept: 'application/json'
},
params: { uploadType: 'multipart' },
validateStatus: [Function (anonymous)],
retry: true,
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
_flush: [Function: flush],
[Symbol(kCapture)]: false,
[Symbol(kTransformState)]: [Object]
},
responseType: 'json',
retryConfig: {
currentRetryAttempt: 0,
retry: 3,
httpMethodsToRetry: [Array],
noResponseRetries: 2,
statusCodesToRetry: [Array]
}
},
code: 403,
errors: [
{
domain: 'global',
reason: 'propertyLengthLimitExceeded',
message: 'Properties and app properties are limited to 124 bytes in UTF-8 encoding, counting both the key and the value.'
}
]
}
(node:4380) UnhandledPromiseRejectionWarning: ReferenceError: res is not defined
at D:\Homebrewery\homebrewery\server\googleActions.js:204:4
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.newGoogleBrew (D:\Homebrewery\homebrewery\server\googleActions.js:198:15)
at async newGoogleBrew (D:\Homebrewery\homebrewery\server\homebrew.api.js:127:18)
(node:4380) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

@G-Ambatte
Copy link
Collaborator Author

Focusing on this line: GaxiosError: Properties and app properties are limited to 124 bytes in UTF-8 encoding, counting both the key and the value., using the Marked.js demo page to view the raw lexer output, the first paragraph token contains *\n A mask made from the skull of the devil who's essence is giving it its powers. Its name \"Retifer\" stands carved in Infernal upon the brows.\n* which, when I dropped it into Notepad++, is reported at 150 characters long.
Reducing this line to A mask made from the skull of the devil who's essence is giving it its powers. causes it to save correctly on the live site (https://homebrewery.naturalcrit.com/edit/1L6WoLrZz6u3jleaar7RlsebmBZ3cOk7D5djBAX58F5Ac).

@calculuschild
Copy link
Member

Tada! Wow who would've thought. Ok, so we just need to limit the max number of characters in titles. Shouldn't be too bad of a fix. I'm honestly surprised it came down to an issue with the title after all. 😅

@G-Ambatte
Copy link
Collaborator Author

Ditto and likewise. I'm busy right now but I should be able to put together a PR later today.

@G-Ambatte
Copy link
Collaborator Author

I've submitted PR #1251 now; it appears to solve the saving issue on my local installation.
Getting the code to instead select the heading would be a better solution, but that would also suffer the same issue, if that heading should be longer than 124 bytes, so limiting the title length is probably required any way.

@G-Ambatte
Copy link
Collaborator Author

Closing as the PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants