Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
08c88c2
onStartup add defer and defalt query
Sergeant61 Dec 22, 2022
84164e5
Merge branch 'master' into master
StorytellerCZ Jan 19, 2024
7e7d6c5
Merge branch 'master' into master
StorytellerCZ Feb 28, 2024
1f53e7f
Initializing Meteor 3 works
StorytellerCZ Feb 28, 2024
c2977be
Remove Travis
StorytellerCZ Feb 28, 2024
3da2bd2
Update GitHub lint action
StorytellerCZ Feb 28, 2024
d79e8a7
Published mizzao:user-status@2.0.0-beta.0
StorytellerCZ Jun 18, 2024
83745ca
Merge branch 'master' into master
StorytellerCZ Jun 18, 2024
c510694
Merge branch 'master' into feature/meteor-3
StorytellerCZ Jun 18, 2024
d12e2f3
Update mizzao:timesync
StorytellerCZ Jun 18, 2024
1efb981
Update changelog
StorytellerCZ Jun 18, 2024
3ccb1a4
Merge branch 'master' into feature/meteor-3
StorytellerCZ Jul 16, 2024
c5d9308
Update eslint to v9
StorytellerCZ Jul 16, 2024
010845d
Update CI
StorytellerCZ Jul 16, 2024
d6c8b97
Merge branch 'feature/meteor-3' into master
StorytellerCZ Jul 16, 2024
680958a
Merge pull request #163 from Sergeant61/master
StorytellerCZ Jul 16, 2024
91798ee
Fix merge issue
StorytellerCZ Jul 16, 2024
a0a9280
Added notes for PR 163
StorytellerCZ Jul 16, 2024
79a13d0
Asyncify test
StorytellerCZ Jul 16, 2024
e771be7
Close #129
StorytellerCZ Jul 16, 2024
651839c
Merge branch 'master' into feature/meteor-3
StorytellerCZ Aug 1, 2024
ee3f3e3
Update use of mizzao:timesync
StorytellerCZ Sep 17, 2024
73ccd8d
Published mizzao:user-status@2.0.0-rc.2
StorytellerCZ Sep 17, 2024
f2c438d
Merge remote-tracking branch 'origin/master' into feature/meteor-3
harryadel May 17, 2026
06a6cc4
Prepare 2.0.0-rc.3 for Meteor 3
harryadel May 17, 2026
9206a37
Drop Meteor 2 support for rc.4
harryadel May 17, 2026
b6fb8a9
Remove legacy CI references
harryadel May 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .eslintrc

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
name: Javascript standard lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-18-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.os }}-node-20-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-18-
${{ runner.os }}-node-20-
- name: Install dependencies
run: npm ci
- name: Run lint
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# the test suite runs the tests (headless, server+client) for multiple Meteor releases
# the test suite runs the tests (headless, server+client) for Meteor 3
name: Test suite
on:
push:
Expand All @@ -10,20 +10,18 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
meteorRelease:
- "--release 2.7"
- "--release 2.8.1"
- "--release 2.15"
# Latest version
- "--release 3.0"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "14.x"
node-version: "20.x"

- name: Install Dependencies
run: |
Expand Down
11 changes: 7 additions & 4 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ In order to `meteor publish`, you will need to be added as a maintainer to this
meteor admin maintainers mizzao:user-status --list
```

# Travis CI
# GitHub Actions

To be written.
Continuous integration runs with GitHub Actions:

- lint checks run in `.github/workflows/lint.yml`
- package tests run in `.github/workflows/testsuite.yml`
- CodeQL analysis runs in `.github/workflows/codeql.yml`

See https://travis-ci.org/Meteor-Community-Packages/meteor-user-status
See https://github.com/Meteor-Community-Packages/meteor-user-status/actions

# Pushing a demo

To be written.

We host the demo at https://user-status.meteorapp.com.

12 changes: 10 additions & 2 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
## vNEXT

## v1.1.1
## v2.0.0
* Add newer Meteor versions to `versionsFrom`
* Minimum Meteor version is 3.0
* onStartup add defer and default query [PR](https://github.com/Meteor-Community-Packages/meteor-user-status/pull/163) [@Sergeant61](https://github.com/Sergeant61)
* Completed async/Fibers compatibility work for Meteor 3
* Updated to eslint v9
* Updated `mizzao:timesync` compatibility to use the stable Meteor 3 `1.0.0` release
* Published release candidate `2.0.0-rc.3`
* Published release candidate `2.0.0-rc.4` targeting Meteor 3 only
* Removed remaining legacy CI documentation and completed the move to GitHub Actions

## v1.1.0

Expand All @@ -24,7 +32,7 @@
* Upgraded timesync to 0.5.1
* Formatted all JS, CSS, and HTML files to jsbeautify specs
* Updated all references of github.com/mizzao to github.com/Meteor-Community-Packages
* Changed TravisCI to use Node 8.15.1 and added lint checks
* Updated CI to use Node 8.15.1 and added lint checks
* Added Visual Studio Code settings.json
* Changed all tabs to 2 spaces
* Minimum meteor requirement now 1.7.0.5
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ Install using Meteor:
$ meteor add mizzao:user-status
```

### Compatibility

The `2.0.0` release candidates target Meteor 3.0 and newer, and use the stable
`mizzao:timesync@1.0.0` package. Meteor 2.x applications should stay on the
`1.x` line of this package until the application is ready to migrate to Meteor 3.

Additionally, note that to read client IP addresses properly, you must set the
`HTTP_FORWARDED_COUNT` environment variable for your app, and make sure that IP
address headers are forwarded for any reverse proxy installed in front of the
Expand Down Expand Up @@ -117,7 +123,9 @@ The `UserStatus.connections` (in-memory) collection contains information for all

#### startupQuerySelector (Optional)

On startup `meteor-user-status` automatically resets all users to `offline` and then marks each `online` as connections are reestablished.
On startup `meteor-user-status` automatically resets online users to `offline`
using the default selector `{ "status.online": true }`, then marks users
`online` again as connections are reestablished.

To customize this functionality you can use the `startupQuerySelector` [Meteor package option](https://docs.meteor.com/api/packagejs.html#options) like this:
```javascript
Expand Down Expand Up @@ -199,8 +207,9 @@ The `UserStatus.events` object is an `EventEmitter` on which you can listen for
Check out https://github.com/mizzao/meteor-accounts-testing for a simple accounts drop-in that you can use to test your app - this is also used in the demo.

#### Startup selector
By default, the startup selector for resetting user status is `{}`.
If you want to change that you can set the default selector in your settings.json file:
By default, the startup selector for resetting user status is
`{ "status.online": true }`. If you want to change that you can set the default
selector in your settings.json file:

```json
{
Expand Down
4 changes: 2 additions & 2 deletions client/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ export const MonitorInternals = {
},

reportIdle(time) {
return Meteor.call('user-status-idle', time);
return Meteor.callAsync('user-status-idle', time);
},

reportActive(time) {
return Meteor.call('user-status-active', time);
return Meteor.callAsync('user-status-active', time);
}

};
Expand Down
43 changes: 43 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import globals from 'globals';
import babelParser from '@babel/eslint-parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["node_modules/*", "packages/*", "**/phantom_runner.js", "**/start_test.js", "**/eslint.config.mjs"],
}, ...compat.extends("eslint:recommended"), {
languageOptions: {
globals: {
...globals.node,
...globals.commonjs,
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},

parser: babelParser,
ecmaVersion: 2018,
sourceType: "module",

parserOptions: {
allowImportExportEverywhere: true,
requireConfigFile: false,
},
},

rules: {
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"],
"no-console": "off",
},
}];
Loading
Loading