apostrophecms / apostrophecms/apostrophe

3.5: MongoDb driver deprecation warning

Open
#3,474 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
4.6k
Forks
650
Avg merge
19h 21m
Merged PRs (30d)
23

Description

## To Reproduce

Start the application. The warning `isConnected is deprecated and will be removed in the next major version` is printed out in the console output.

## Expected behavior
No deprecation warning.

## Describe the bug
From the [documentation of the currently used driver](https://mongodb.github.io/node-mongodb-native/3.6/reference/unified-topology/#mongoclient-connect-isconnected), isConnected method is deprecated and will be removed in the next major version.

If `--trace-warnings` is used when starting the app, it's seen the problem is caused by the direct apostrophe dependency `connect-mongo@3.2.0` module used by Apostrophe. The `isConnected` use is removed in v4 of the module.

The migration to v4 of the module seems painless according to their [migration guide](https://github.com/jdesboeufs/connect-mongo/blob/master/MIGRATION_V4.md)

## Details

**Version of Node.js:**
v12.21.0

**Apostrophe:**
apostrophe@3.5.0 (against `main` branch)

**MongoDB driver:**
mongodb@3.7.2 (as reported by `npm ls`)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the warning with --trace-warnings and inspect the direct connect-mongo@3.2.0 dependency identified in the report. Review the linked connect-mongo v4 migration guide and verify that starting the application no longer emits the isConnected deprecation warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, nodejs
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.