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

chore: upgrade dependencies #1153

Merged
merged 16 commits into from Apr 28, 2021
Merged

chore: upgrade dependencies #1153

merged 16 commits into from Apr 28, 2021

Conversation

lamkeewei
Copy link
Contributor

@lamkeewei lamkeewei commented Apr 27, 2021

Upgraded

Dependency From To
redis 3.0.2 3.1.2
react-draft-wysiwyg 1.14.5 1.14.6
validator 13.0.0 13.6.0
@types/cheerio 0.22.24 0.22.28
@types/node 14.14.31 14.14.42
twilio 3.55.1 3.58.0
moment 2.24.0 2.29.1
@types/papaparse 5.0.3 5.2.5

@zwliew
Copy link
Contributor

zwliew commented Apr 27, 2021

Can I include the @types/express update (#1102) in this as well? A quick build works fine

@lamkeewei
Copy link
Contributor Author

Can I include the @types/express update (#1102) in this as well? A quick build works fine

Sure!

This forces @types/serve-static to update to fix a build error:

node_modules/@types/express/index.d.ts(58,29): error TS2694: Namespace 'serveStatic' has no exported member 'RequestHandlerConstructor'.
Errors:

src/core/middlewares/campaign.middleware.ts(109,7): error TS2322: Type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to type 'number'.
  Type 'undefined' is not assignable to type 'number'.
src/core/middlewares/campaign.middleware.ts(110,7): error TS2322: Type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to type 'number'.
  Type 'undefined' is not assignable to type 'number'.
src/core/middlewares/upload.middleware.ts(21,7): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
src/core/middlewares/upload.middleware.ts(56,7): error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[] | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
zwliew and others added 2 commits April 28, 2021 11:00
We might need to upgrade celebrate to fix the type definitions for this.
Look into that later.

This reverts commits 73bbb3f,
cec757a, and 858c4b8.
@lamkeewei lamkeewei requested a review from zwliew April 28, 2021 07:05
Error:
/home/travis/build/opengovsg/postmangovsg/frontend/src/services/telegram.service.ts
TypeScript error in /home/travis/build/opengovsg/postmangovsg/frontend/src/services/telegram.service.ts(149,15):
Object is possibly 'undefined'.  TS2532
    147 |             delimiter === ',' &&
    148 |               // papaparse parses everything, including images, pdfs... This checks that at least one of the columns is sane
  > 149 |               fields.some((field) => /^[a-zA-Z0-9\s-_'"/]+$/.test(field))
        |               ^
    150 |           )
    151 |         },
    152 |         error: function () {

The change that caused it:
DefinitelyTyped/DefinitelyTyped@d54d340
Also fix the following build error:
src/core/services/parse-csv.service.ts:55:15 - error TS2532: Object is possibly 'undefined'.

55               meta.fields?.length > 0 &&
                 ~~~~~~~~~~~~~~~~~~~

Fix this by changing `meta.fields?.length > 0` to `meta.fields?.length`
since this would check for non-undefinedness and a non-zero number at
the same time.
Copy link
Contributor

@zwliew zwliew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Tested the following on staging backend and worker:

  1. Sending a validation SMS works
  2. Parsing CSV file works
  3. Creating and sending a campaign works

Tested the following on frontend locally:

  1. Exported at time is formatted correctly
  2. Inputting text in the rich text editor works

@zwliew zwliew merged commit a5dec44 into develop Apr 28, 2021
@zwliew zwliew deleted the upgrade-deps branch April 28, 2021 08:19
lamkeewei added a commit that referenced this pull request May 5, 2021
* develop:
  refactor: use shared function to initialize models (#1172)
  chore: setup scaffolding for backend tests (#940)
  1.23.0
  fix(frontend): fix frontend test flakiness (#1162)
  fix: update successful delivery status only if error does not exist (#1150)
  chore: upgrade dependencies (#1153)
  feat: add unit tests for error states in critical workflows (#1118)
  feat: support whitelisting domains through `agencies` table (#1141)
  feat: add tests for happy paths in critical workflows (#1110)
  fix: prevent campaign names from causing dashboard rows to overflow (#1147)
  fix(email): Fix SendGrid fallback integration (#1026)
lamkeewei added a commit that referenced this pull request May 5, 2021
* develop:
  feat: refactor msg template components; add telegram character limit (#1148)
  refactor: use shared function to initialize models (#1172)
  chore: setup scaffolding for backend tests (#940)
  1.23.0
  fix(frontend): fix frontend test flakiness (#1162)
  fix: update successful delivery status only if error does not exist (#1150)
  chore: upgrade dependencies (#1153)
  feat: add unit tests for error states in critical workflows (#1118)
  feat: support whitelisting domains through `agencies` table (#1141)
  feat: add tests for happy paths in critical workflows (#1110)
  fix: prevent campaign names from causing dashboard rows to overflow (#1147)
lamkeewei added a commit that referenced this pull request May 10, 2021
* develop:
  fix: fix error when updating Telegram ID for an existing phone number (#1178)
  chore: upgrade React; use new JSX transform; sort imports (#1129)
  fix(backend): docker build and tsc output directory structure (#1177)
  feat: refactor msg template components; add telegram character limit (#1148)
  refactor: use shared function to initialize models (#1172)
  chore: setup scaffolding for backend tests (#940)
  1.23.0
  fix(frontend): fix frontend test flakiness (#1162)
  fix: update successful delivery status only if error does not exist (#1150)
  chore: upgrade dependencies (#1153)
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

Successfully merging this pull request may close these issues.

None yet

3 participants