-
Notifications
You must be signed in to change notification settings - Fork 549
[Web Portal] Replace the suffix if a cloned job is resubmited #2451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Buffer is a node.js only feature, and ES2015 standard have TypedArray which provides similar functionalities. Shall we use TypedArray instead, to follow more to standard?
@@ -28,6 +28,7 @@ const userAuth = require('../../user/user-auth/user-auth.component'); | |||
const jobSchema = require('./job-submit.schema.js'); | |||
const querystring = require('querystring'); | |||
const stripJsonComments = require('strip-json-comments'); | |||
const uuid = require('uuid'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not seen the uuid
included in package.json
, and I don't think uuid is required here. In browser side, uuid just uses crypto level random number instead of Math.random()
to avoid more collisions, since we have a directly response when user is submitting with the same job name, so I don't think avoid more collisions here is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Webpack uses feross/buffer v4 as nodejs Buffer's browser implementation if feross/buffer uses Uint8Array by default and object as shim. TextEncoder is another solution if we just want to convert a string to uint8array. |
I see and think that it is not necessary to introduce such a dependency. |
OK, I'll use TextEncoder instead |
Please pay attention to MS Edge compatibility since encoding standard is still in development |
Since we only need to calc a checksum, I'll use the last byte of the charcter code |
#2361