diff --git a/docs/history.md b/docs/history.md
index 4e96f7d2fa..a820c10a28 100644
--- a/docs/history.md
+++ b/docs/history.md
@@ -3,7 +3,7 @@
#### Highlights
* New MongoDB Package Async API. [PR](https://github.com/meteor/meteor/pull/12028)
* Node update to [v14.20.0](https://nodejs.org/en/blog/release/v14.20.0/) as part of the [July 7th security release](https://nodejs.org/en/blog/vulnerability/july-2022-security-releases/)
-* Update MongoDB driver to 4.8. [PR](https://github.com/meteor/meteor/pull/12097)
+* Update MongoDB driver to 4.9. [PR](https://github.com/meteor/meteor/pull/12097)
#### Breaking Changes
N/A
@@ -15,19 +15,38 @@ Read our [Migration Guide](https://deploy-preview-12057--meteor-guide.netlify.ap
* `modules@0.19.0`:
- Updating reify version. [PR](https://github.com/meteor/meteor/pull/12055).
* `minimongo@1.9.0`:
- - New methods to work with the Async API. [PR](https://github.com/meteor/meteor/pull/12028/files).
+ - New methods to work with the Async API. [PR](https://github.com/meteor/meteor/pull/12028).
+ - Solved invalid dates in Minimongo Matcher [PR](https://github.com/meteor/meteor/pull/12165).
* `mongo@1.16.0`:
- Adding async counterparts that allows gradual migration from Fibers. [PR](https://github.com/meteor/meteor/pull/12028).
+ - Improved oplogV2V1Converter implementation. [PR](https://github.com/meteor/meteor/pull/12116).
+ - Exit on MongoDB connection error. [PR](https://github.com/meteor/meteor/pull/12115).
+ - Fixed MongoConnection._onFailover hook. [PR](https://github.com/meteor/meteor/pull/12125).
+ - Fixed handling objects in oplogV2V1Converter. [PR](https://github.com/meteor/meteor/pull/12107).
* `meteor@1.10.1`:
- Create method to check if Fibers is enabled by flag DISABLE_FIBERS. [PR](https://github.com/meteor/meteor/pull/12100).
-* `npm-mongo@4.8.0`:
- - Updated MongoDB driver to 4.8. [PR](https://github.com/meteor/meteor/pull/12097).
+ - Fix bugs for linter build plugins. [PR](https://github.com/meteor/meteor/pull/12120).
+ - Document meteor show METEOR. [PR](https://github.com/meteor/meteor/pull/12124).
+ - Update Cordova Android to 10.1.2. [PR](https://github.com/meteor/meteor/pull/12131).
+ - Fixed flaky test. [PR](https://github.com/meteor/meteor/pull/12129).
+ - Refactoring/Remove unused imports from tools folder. [PR](https://github.com/meteor/meteor/pull/12084).
+ - Fix problem when publishing async methods. [PR](https://github.com/meteor/meteor/pull/12152).
+ - Update skeletons Apollo[PR](https://github.com/meteor/meteor/pull/12091) and other skeletons [PR](https://github.com/meteor/meteor/pull/12099)
+* `meteor-installer@2.7.5`:
+ - Validates required Node.js version. [PR](https://github.com/meteor/meteor/pull/12066).
+* `npm-mongo@4.9.0`:
+ - Updated MongoDB driver to 4.9. [PR](https://github.com/meteor/meteor/pull/12163).
+
#### Independent Releases
* `accounts-passwordless@2.1.3`:
- - Fixing bug where tokes where never expiring. [PR](https://github.com/meteor/meteor/pull/12088).
+ - Fixing bug where tokens where never expiring. [PR](https://github.com/meteor/meteor/pull/12088).
* `accounts-base@2.2.4`:
- Adding new options to the `Accounts.config()` method: `loginTokenExpirationHours` and `tokenSequenceLength`. [PR](https://github.com/meteor/meteor/pull/12088).
+* `Meteor Repo`:
+ - Included githubactions in the dependabot config. [PR](https://github.com/meteor/meteor/pull/12061).
+ - Visual rework in meteor readme. [PR](https://github.com/meteor/meteor/pull/12133).
+ - Remove useraccounts from Guide. [PR](https://github.com/meteor/meteor/pull/12090).
* `minifier-css@1.6.1`:
- Update postcss package to avoid issues with `Browserslist` and `caniuse-lite`. [PR](https://github.com/meteor/meteor/pull/12136).
* `minifier-js@2.7.5`:
@@ -36,6 +55,23 @@ Read our [Migration Guide](https://deploy-preview-12057--meteor-guide.netlify.ap
- Update dependencies to avoid issues with `Browserslist` and `caniuse-lite`. [PR](https://github.com/meteor/meteor/pull/12141).
* `standard-minifier-js@2.8.1`:
- Update dependencies to avoid issues with `Browserslist` and `caniuse-lite`. [PR](https://github.com/meteor/meteor/pull/12142).
+* `ddp-server@2.5.1`:
+ - Rename setPublicationStrategy and getPublicationStrategy arguments. [PR](https://github.com/meteor/meteor/pull/12166).
+
+#### Special thanks to
+- [@fredmaiaarantes](https://github.com/fredmaiaarantes)
+- [@radekmie](https://github.com/radekmie)
+- [@naveensrinivasan](https://github.com/naveensrinivasan)
+- [@zodern](https://github.com/zodern)
+- [@brucejo75](https://github.com/brucejo75)
+- [@matheusccastroo](https://github.com/matheusccastroo)
+- [@victoriaquasar](https://github.com/victoriaquasar)
+- [@StorytellerCZ](https://github.com/StorytellerCZ)
+- [@Grubba27](https://github.com/Grubba27)
+- [@denihs](https://github.com/denihs)
+- [@edimarlnx](https://github.com/edimarlnx)
+
+For making this great framework even better!
## v2.7.3, 2022-05-31
diff --git a/docs/source/api/pubsub.md b/docs/source/api/pubsub.md
index 414a0bc0dc..76f1343952 100644
--- a/docs/source/api/pubsub.md
+++ b/docs/source/api/pubsub.md
@@ -303,7 +303,7 @@ You can use the following methods to set or get the publication strategy for pub
{% apibox "setPublicationStrategy" %}
-For publication `foo`, you can set `NO_MERGE` strategy as shown:
+For the `foo` collection, you can set the `NO_MERGE` strategy as shown:
```js
import { DDPServer } from "meteor/ddp-server";
diff --git a/guide/source/2.8-migration.md b/guide/source/2.8-migration.md
index a788a04eed..ae66e3c94d 100644
--- a/guide/source/2.8-migration.md
+++ b/guide/source/2.8-migration.md
@@ -36,33 +36,10 @@ Here are the newly added methods (you can see this description and the code [her
```js
for await (const document of collection.find(query, options)) /* ... */
```
-**A few internal methods are now async.**
-
- - These are: `MongoConnection` (constructor), `MongoInternals.RemoteCollectionDriver` (constructor), `MongoInternals.defaultRemoteCollectionDriver`, `OplogHandle` (constructor).
-
-Adding these async counterparts allows gradual migration, as both versions will coexist for the time being. At the moment, all async methods are calling sync one directly, so all hooks and wrappers should work as expected.
Can I update to this version without changing my app?
-Yes and no.
-
-If you're not using any constructor, like `MongoInternals.RemoteCollectionDriver`, then yes. Your app will run normally.
-
-But if you're using a construction like that one, then an error will be thrown because these are async now. In this case, you have two options:
- - You can wrap the call in an async function, like so:
- ```js
- async function Connection() {
- return await MongoInternals.RemoteCollectionDriver(/.../)
- }
- ```
- - Use `.await()`, like so:
- ```js
- const Connection = new MongoInternals.RemoteCollectionDriver(/.../).await();
- ```
-
-The last option is easier for a quick fix. Just bear in mind that the function `.await()` is working with Fibers, meaning that it'll be deprecated in the future.
-
-Also, remember to add the `ecmascript` package, otherwise the async won't work. The `ecmascript` package has the build plugin that compiles await and async to run within fibers.
+Yes. You can update to this version without changing your app.
Migrating from a version older than 2.8?
diff --git a/packages/ddp-server/livedata_server.js b/packages/ddp-server/livedata_server.js
index 4eaaf30433..140863651b 100644
--- a/packages/ddp-server/livedata_server.js
+++ b/packages/ddp-server/livedata_server.js
@@ -1517,33 +1517,33 @@ Object.assign(Server.prototype, {
},
/**
- * @summary Set publication strategy for the given publication. Publications strategies are available from `DDPServer.publicationStrategies`. You call this method from `Meteor.server`, like `Meteor.server.setPublicationStrategy()`
+ * @summary Set publication strategy for the given collection. Publications strategies are available from `DDPServer.publicationStrategies`. You call this method from `Meteor.server`, like `Meteor.server.setPublicationStrategy()`
* @locus Server
* @alias setPublicationStrategy
- * @param publicationName {String}
+ * @param collectionName {String}
* @param strategy {{useCollectionView: boolean, doAccountingForCollection: boolean}}
* @memberOf Meteor.server
* @importFromPackage meteor
*/
- setPublicationStrategy(publicationName, strategy) {
+ setPublicationStrategy(collectionName, strategy) {
if (!Object.values(publicationStrategies).includes(strategy)) {
throw new Error(`Invalid merge strategy: ${strategy}
- for collection ${publicationName}`);
+ for collection ${collectionName}`);
}
- this._publicationStrategies[publicationName] = strategy;
+ this._publicationStrategies[collectionName] = strategy;
},
/**
- * @summary Gets the publication strategy for the requested publication. You call this method from `Meteor.server`, like `Meteor.server.getPublicationStrategy()`
+ * @summary Gets the publication strategy for the requested collection. You call this method from `Meteor.server`, like `Meteor.server.getPublicationStrategy()`
* @locus Server
* @alias getPublicationStrategy
- * @param publicationName {String}
+ * @param collectionName {String}
* @memberOf Meteor.server
* @importFromPackage meteor
* @return {{useCollectionView: boolean, doAccountingForCollection: boolean}}
*/
- getPublicationStrategy(publicationName) {
- return this._publicationStrategies[publicationName]
+ getPublicationStrategy(collectionName) {
+ return this._publicationStrategies[collectionName]
|| this.options.defaultPublicationStrategy;
},
diff --git a/packages/minimongo/matcher.js b/packages/minimongo/matcher.js
index 15003628b3..a55a9d879b 100644
--- a/packages/minimongo/matcher.js
+++ b/packages/minimongo/matcher.js
@@ -262,8 +262,8 @@ LocalCollection._f = {
if (ta === 9) { // Date
// Convert to millis.
ta = tb = 1;
- a = a.getTime();
- b = b.getTime();
+ a = isNaN(a) ? 0 : a.getTime();
+ b = isNaN(b) ? 0 : b.getTime();
}
if (ta === 1) { // double
diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js
index 0d99c9d91c..f1d35b8fba 100644
--- a/packages/minimongo/minimongo_tests_client.js
+++ b/packages/minimongo/minimongo_tests_client.js
@@ -439,8 +439,16 @@ Tinytest.add('minimongo - selector_compiler', test => {
// dates
const date1 = new Date;
const date2 = new Date(date1.getTime() + 1000);
+ const date3 = new Date('');
match({a: date1}, {a: date1});
nomatch({a: date1}, {a: date2});
+ match({a: date3}, {a: date3});
+ nomatch({a: date1}, {a: date3});
+ nomatch({a: date3}, {a: date1});
+ match({a: {$gt: date3}}, {a: date1});
+ match({a: {$gte: date3}}, {a: date1});
+ nomatch({a: {$lt: date3}}, {a: date1});
+ nomatch({a: {$lte: date3}}, {a: date1});
// arrays
diff --git a/packages/mongo/mongo_livedata_tests.js b/packages/mongo/mongo_livedata_tests.js
index 18bbb727db..c6a2484728 100644
--- a/packages/mongo/mongo_livedata_tests.js
+++ b/packages/mongo/mongo_livedata_tests.js
@@ -3229,19 +3229,18 @@ Meteor.isServer && testAsyncMulti("mongo-livedata - update with replace forbidde
}
]);
-// TODO this is commented for now, but we need to find out the cause
-// PR: https://github.com/meteor/meteor/pull/12057
-// Meteor.isServer && Tinytest.add(
-// "mongo-livedata - connection failure throws",
-// function (test) {
-// test.throws(function () {
-// const connection = new MongoInternals.Connection('mongodb://this-does-not-exist.test/asdf');
-//
-// // Same as `MongoInternals.defaultRemoteCollectionDriver`.
-// Promise.await(connection.client.connect());
-// });
-// }
-// );
+Meteor.isServer && Tinytest.add(
+ "mongo-livedata - connection failure throws",
+ function (test) {
+ // Exception happens in 30s
+ test.throws(function () {
+ const connection = new MongoInternals.Connection('mongodb://this-does-not-exist.test/asdf');
+
+ // Same as `MongoInternals.defaultRemoteCollectionDriver`.
+ Promise.await(connection.client.connect());
+ });
+ }
+);
Meteor.isServer && Tinytest.add("mongo-livedata - npm modules", function (test) {
// Make sure the version number looks like a version number.
diff --git a/packages/mongo/oplog_tests.js b/packages/mongo/oplog_tests.js
index dfa66bf613..bb3374f8fb 100644
--- a/packages/mongo/oplog_tests.js
+++ b/packages/mongo/oplog_tests.js
@@ -164,20 +164,27 @@ process.env.MONGO_OPLOG_URL && testAsyncMulti(
]
);
-// TODO this is commented for now, but we need to find out the cause
-// PR: https://github.com/meteor/meteor/pull/12057
-// Tinytest.addAsync("mongo-livedata - oplog - _onFailover", async () => {
-// const driver = MongoInternals.defaultRemoteCollectionDriver();
-// const failoverPromise = new Promise(resolve => {
-// driver.mongo._onFailover(() => {
-// resolve();
+
+// Meteor.isServer && Tinytest.addAsync(
+// "mongo-livedata - oplog - _onFailover",
+// async function (test) {
+// const driver = MongoInternals.defaultRemoteCollectionDriver();
+// const failoverPromise = new Promise(resolve => {
+// driver.mongo._onFailover(() => {
+// resolve(true);
+// });
// });
-// });
//
-// await driver.mongo.db.admin().command({
-// replSetStepDown: 1,
-// force: true
-// });
//
-// return failoverPromise;
-// });
+// await driver.mongo.db.admin().command({
+// replSetStepDown: 1,
+// force: true
+// });
+//
+// try {
+// const result = await failoverPromise;
+// test.isTrue(result);
+// } catch (e) {
+// test.fail({ message: "Error waiting on Promise", value: JSON.stringify(e) });
+// }
+// });
diff --git a/packages/npm-mongo/.npm/package/npm-shrinkwrap.json b/packages/npm-mongo/.npm/package/npm-shrinkwrap.json
index 2de006917d..bdf03af949 100644
--- a/packages/npm-mongo/.npm/package/npm-shrinkwrap.json
+++ b/packages/npm-mongo/.npm/package/npm-shrinkwrap.json
@@ -2,9 +2,9 @@
"lockfileVersion": 1,
"dependencies": {
"@types/node": {
- "version": "18.6.1",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.6.1.tgz",
- "integrity": "sha512-z+2vB6yDt1fNwKOeGbckpmirO+VBDuQqecXkgeIqDlaOtmKn6hPR/viQ8cxCfqLU4fTlvM3+YjM367TukWdxpg=="
+ "version": "18.7.13",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz",
+ "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw=="
},
"@types/webidl-conversions": {
"version": "6.1.1",
@@ -22,9 +22,9 @@
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
},
"bson": {
- "version": "4.6.5",
- "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.5.tgz",
- "integrity": "sha512-uqrgcjyOaZsHfz7ea8zLRCLe1u+QGUSzMZmvXqO24CDW7DWoW1qiN9folSwa7hSneTSgM2ykDIzF5kcQQ8cwNw=="
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/bson/-/bson-4.7.0.tgz",
+ "integrity": "sha512-VrlEE4vuiO1WTpfof4VmaVolCVYkYTgB9iWgYNOrVlnifpME/06fhFRmONgBhClD5pFC1t9ZWqFUQEQAzY43bA=="
},
"buffer": {
"version": "5.7.1",
@@ -52,9 +52,9 @@
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg=="
},
"mongodb": {
- "version": "4.8.0",
- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.8.0.tgz",
- "integrity": "sha512-a0eVzm1e1kxwnzJV1wZXIS54KegM2y6wXTXOGTSAxr/E2YOUkl/zGBHNSI4z+6z+YQtVdzDqy1nJ4n5MxYJRnQ=="
+ "version": "4.9.0",
+ "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.9.0.tgz",
+ "integrity": "sha512-tJJEFJz7OQTQPZeVHZJIeSOjMRqc5eSyXTt86vSQENEErpkiG7279tM/GT5AVZ7TgXNh9HQxoa2ZkbrANz5GQw=="
},
"mongodb-connection-string-url": {
"version": "2.5.3",
diff --git a/packages/npm-mongo/package.js b/packages/npm-mongo/package.js
index 09c4f277c0..47eab76443 100644
--- a/packages/npm-mongo/package.js
+++ b/packages/npm-mongo/package.js
@@ -3,12 +3,12 @@
Package.describe({
summary: "Wrapper around the mongo npm package",
- version: "4.8.0-beta280.5",
+ version: "4.9.0-beta280.5",
documentation: null
});
Npm.depends({
- mongodb: "4.8.0"
+ mongodb: "4.9.0"
});
Package.onUse(function (api) {
diff --git a/packages/test-in-console/driver.js b/packages/test-in-console/driver.js
index 018680e56f..7b8711ad75 100644
--- a/packages/test-in-console/driver.js
+++ b/packages/test-in-console/driver.js
@@ -2,10 +2,16 @@
DONE = false;
// Failure count for phantomjs exit code
FAILURES = null;
+// Where are the failures
+WHERE_FAILED = [];
+// Passed count for phantomjs exit code
+PASSED = null;
TEST_STATUS = {
DONE: false,
- FAILURES: null
+ FAILURES: null,
+ PASSED: null,
+ WHERE_FAILED: []
};
// xUnit format uses XML output
@@ -55,6 +61,7 @@ var xunit = function (s) {
var passed = 0;
var failed = 0;
+var whereFailed = [];
var expected = 0;
var resultSet = {};
var toReport = [];
@@ -163,6 +170,7 @@ runTests = function () {
report(name, true);
log(name, ":", "!!!!!!!!! FAIL !!!!!!!!!!!");
log(JSON.stringify(resultSet[name].info));
+ whereFailed.push({ name: name, info: JSON.stringify(resultSet[name].info) });
break;
default:
log(name, ": unknown state for the test to be in");
@@ -187,10 +195,14 @@ runTests = function () {
log("Waiting 3s for any last reports to get sent out");
setTimeout(function () {
TEST_STATUS.FAILURES = FAILURES = failed;
+ TEST_STATUS.WHERE_FAILED = WHERE_FAILED = whereFailed;
+ TEST_STATUS.PASSED = PASSED = passed;
TEST_STATUS.DONE = DONE = true;
}, 3000);
} else {
TEST_STATUS.FAILURES = FAILURES = failed;
+ TEST_STATUS.WHERE_FAILED = WHERE_FAILED = whereFailed;
+ TEST_STATUS.PASSED = PASSED = passed;
TEST_STATUS.DONE = DONE = true;
}
});
diff --git a/packages/test-in-console/puppeteerRunner.js b/packages/test-in-console/puppeteerRunner.js
index 9a09024a59..a2d07f633f 100644
--- a/packages/test-in-console/puppeteerRunner.js
+++ b/packages/test-in-console/puppeteerRunner.js
@@ -4,7 +4,9 @@ async function runNextUrl(browser) {
const page = await browser.newPage();
page.on('console', msg => {
- console.log(msg._text);
+ if (msg._text !== undefined) {
+ console.log(msg._text);
+ }
});
if (!process.env.URL) {
@@ -17,7 +19,11 @@ async function runNextUrl(browser) {
async function poll() {
if (await isDone(page)) {
let failCount = await getFailCount(page);
+ console.log(`Tests complete with ${failCount} failures`);
+ console.log(`Tests complete with ${await getPassCount(page)} passes`);
if (failCount > 0) {
+ const failed = await getFailed(page);
+ failed.map( (f) => console.log(`${f.name} failed: ${f.info}`));
await page.close();
await browser.close();
process.exit(1);
@@ -34,6 +40,11 @@ async function runNextUrl(browser) {
poll();
}
+/**
+ *
+ * @param page
+ * @return {Promise}
+ */
async function isDone(page) {
return await page.evaluate(function() {
if (typeof TEST_STATUS !== 'undefined') {
@@ -44,6 +55,26 @@ async function isDone(page) {
});
}
+/**
+ *
+ * @param page
+ * @return {Promise}
+ */
+async function getPassCount(page) {
+ return await page.evaluate(function() {
+ if (typeof TEST_STATUS !== 'undefined') {
+ return TEST_STATUS.PASSED;
+ }
+
+ return typeof PASSED !== 'undefined' && PASSED;
+ });
+}
+
+/**
+ *
+ * @param page
+ * @return {Promise}
+ */
async function getFailCount(page) {
return await page.evaluate(function() {
if (typeof TEST_STATUS !== 'undefined') {
@@ -58,6 +89,20 @@ async function getFailCount(page) {
});
}
+/**
+ *
+ * @param page
+ * @return {Promise<[{name: string, info: string}]>}
+ */
+async function getFailed(page) {
+ return await page.evaluate(function() {
+ if (typeof TEST_STATUS !== 'undefined') {
+ return TEST_STATUS.WHERE_FAILED;
+ }
+ return typeof WHERE_FAILED !== 'undefined' && WHERE_FAILED;
+ });
+}
+
async function runTests() {
console.log(`Running test with Puppeteer at ${process.env.URL}`);