Skip to content

Update all dependencies to next major version and fix issues caused by update#26

Open
Computroniks wants to merge 14 commits into
louis-lau:masterfrom
SidingsMedia:computroniks/feature/update-deps
Open

Update all dependencies to next major version and fix issues caused by update#26
Computroniks wants to merge 14 commits into
louis-lau:masterfrom
SidingsMedia:computroniks/feature/update-deps

Conversation

@Computroniks

Copy link
Copy Markdown

This PR updates all the dependencies to their most recent major version and fixes all the issues encountered by that update.

In terms of what I have actually changed:

  • Removed snyk (I couldn't run npm install successfully with this still installed as it kept asking for an API key and causing the command to fail)
  • Removed .vscode directory (Probably shouldn't keep editor configs in the repo)
  • Updated all the dependencies to their most recent major version that still works with other dependencies (I think nestjs requires mongodb v5 where as the latest is v6)
  • Added the @nestjs/axios package as @nestjs/common doesn't include HttpModule or HttpService now
  • Removed true from the second argument to new Logger() calls because this is no longer valid`
  • Changed ObjectID to ObjectId
  • Replaced spinner with console.log as nestjs-console no longer includes a spinner and I didn't want to add an extra dependency here just for a spinner
  • Added await keyword in api-keys.service when creating an API key. Without this await the API key is generated but doesn't actually get saved in the database so is unusable.
  • Replaced findOne with findOneBy
  • Renamed classToClass to instanceToInstance as a result of a name change in the package supplying these
  • Fixed jsonParse in the config service to handle new @Transform parameters
  • Fixed resolveDkimId method. The catch block would be run on a 404 response, meaning that the expected 404 would result in DuckyAPI thinking there was an internal server error and failing to add the domain, among other issues.
  • In main.ts fixed how we get the config service to match new nestjs version
  • In delete-for-domain.processor for some reason the data for the job ends up with the user _id being a string, even though when the job was added to the queue it was an ObjectId so just make sure that it is definitely an ObjectId. More detail in 4f61406
  • Switched from .save() to .update() for pushAlias and pullDomain. More details about that in 919a223

I have tested all the functionality from the web UI and it all appears to function correctly, however as this is a fairly large change, if other people could also double check, it would be greatly appreciated.

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Editor config should not be included in the repo

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This method incorrectly caught all errors from the Wildduck API as internal server errors hence failed when adding a new domain

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
The user ID is passed as a string, not an ObjectId so toHexString fails here

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
For some unknown reason, the data for a job when it is run no longer contains the user _id as an ObjectId, even though when the job was added to the queue, it was an ObjectId. Instead it emerges as a string. To fix, just convert back to ObjectId before we do anything else with the job.

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
For some reason, if we try to run .save() after removing the last domain in a users list, the empty array is not saved and the last domain is not deleted. Domains can be deleted if there are more than one, however the very last domain could not.

A similar issue was seen when adding an alias, hence that has also been changed to .update()

The return types of the two methods have been changed, however they are only used in one place each and the return values are not used so there is no issue here.

Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
@Computroniks

Copy link
Copy Markdown
Author

@louis-lau What would your thoughts be on potentially getting this merged? Currently I have this running on a testing system and it seems to be running ok from the basic admin I have done

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.

1 participant