Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/react-native-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ env:
NODE_OPTIONS: --openssl-legacy-provider
CHANGERAWR_API_KEY: ${{ secrets.CHANGERAWR_API_KEY }}
CHANGERAWR_API_URL: ${{ secrets.CHANGERAWR_API_URL }}
YARN_PRODUCTION: 'false'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the Yarn version and whether YARN_PRODUCTION is respected in this project.

# 1. Find the declared Yarn version (package.json engines or .yarnrc)
echo "=== package.json engines field ==="
fd -g 'package.json' --max-depth 1 --exec grep -A3 '"engines"' {} \;

echo ""
echo "=== .yarnrc or .yarnrc.yml ==="
fd -g '.yarnrc*' --max-depth 2 --exec cat {} \;

echo ""
echo "=== yarn.lock format (v1 has '# yarn lockfile v1') ==="
head -5 yarn.lock 2>/dev/null || echo "yarn.lock not found at root"

Repository: Resgrid/Unit

Length of output: 508


🏁 Script executed:

#!/bin/bash
# Rerun with -H flag for hidden files and get more version info

echo "=== .yarnrc or .yarnrc.yml (with hidden files) ==="
fd -H -g '.yarnrc*' --max-depth 2 --exec cat {} \; 2>/dev/null || echo "No .yarnrc files found"

echo ""
echo "=== Full yarn.lock header ==="
head -10 yarn.lock 2>/dev/null

echo ""
echo "=== package.json full content (check for yarn version anywhere) ==="
cat -n package.json | head -50

Repository: Resgrid/Unit

Length of output: 4430


🌐 Web query:

Yarn v1 YARN_PRODUCTION environment variable NODE_ENV production

💡 Result:

In Yarn v1 (Classic):

  • NODE_ENV=production makes yarn install skip devDependencies by default. The Classic docs state: “Yarn will not install any package listed in devDependencies if the NODE_ENV environment variable is set to production.” [1]
  • yarn install --production / --prod is how you force/override that behavior regardless of NODE_ENV (the docs: “Use this flag to instruct Yarn to ignore NODE_ENV and take its production-or-not status from this flag instead.”). [1]

About YARN_PRODUCTION:

  • YARN_PRODUCTION=true is commonly used by Heroku’s Node.js classic buildpack to tell the build to “Only Install dependenciesYARN_PRODUCTION=true for Yarn v1.” [2]
  • Even with production installs, Yarn may still resolve devDependencies during dependency-tree resolution (which can look like it’s “installing” them in logs), but Heroku notes Yarn “isn’t installing the devDependencies” in that case. [3]

Practical combos

  • Local / generic CI: NODE_ENV=production yarn install (or yarn install --prod).
  • Heroku classic buildpack: set YARN_PRODUCTION=true (and/or NPM_CONFIG_PRODUCTION=true) per Heroku docs. [2]

Sources

  1. https://classic.yarnpkg.com/lang/en/docs/cli/install/
  2. https://devcenter.heroku.com/articles/nodejs-classic-buildpack-builds
  3. https://help.heroku.com/AHO7DWSQ/why-is-yarn-installing-my-devdependencies-when-i-am-using-yarn_production-true

🌐 Web query:

YARN_PRODUCTION=false NODE_ENV=production Yarn v1 override precedence

💡 Result:

In Yarn v1 (Classic), the “production install” decision (i.e., whether to skip devDependencies) works like this:

  1. If you pass yarn install --production[=true|false], that flag wins and Yarn ignores NODE_ENV for this decision. So --production=false forces devDependencies to be installed even if NODE_ENV=production. [1]

  2. If you do not pass --production, then NODE_ENV=production makes Yarn skip devDependencies by default. [1]

Separately (and this is often where the confusion comes from): on platforms that do an extra “prune devDependencies” build step (e.g., Heroku’s classic Node buildpack / DigitalOcean App Platform buildpacks), setting:

  • YARN_PRODUCTION=false skips that pruning step even if NODE_ENV=production, effectively letting devDependencies remain installed in the slug/image while keeping NODE_ENV=production. [2][3]

So with YARN_PRODUCTION=false NODE_ENV=production:

  • Yarn v1 itself will still treat NODE_ENV=production as production unless you also pass --production=false. [1]
  • Buildpack pruning, if present, is typically overridden/disabled by YARN_PRODUCTION=false. [2][3]

Sources:
[1] Yarn Classic yarn install --production[=true|false] docs (explains --production overrides/ignores NODE_ENV). (classic.yarnpkg.com)
[2] Heroku “Node.js Classic Buildpack Builds” (Skip pruning using Yarn v1: YARN_PRODUCTION=false). (devcenter.heroku.com)
[3] DigitalOcean App Platform Node.js buildpack docs (Skip pruning: YARN_PRODUCTION=false for Yarn v1). (docs.digitalocean.com)

Citations:


YARN_PRODUCTION=false may not override NODE_ENV=production during Yarn v1 install—confirm EAS CLI behavior and consider alternative fix.

The concern about NODE_ENV=production skipping devDependencies is valid. However, YARN_PRODUCTION=false is designed for buildpack-level pruning steps (Heroku, DigitalOcean), not for Yarn v1's own install behavior. In Yarn v1, only the --production=false CLI flag reliably overrides NODE_ENV=production during install. If EAS CLI internally sets NODE_ENV=production and calls yarn install without the --production=false flag, then YARN_PRODUCTION=false alone will not prevent devDependencies from being skipped.

Verify whether EAS CLI uses a buildpack-style pruning approach (in which case YARN_PRODUCTION=false helps) or directly invokes Yarn install with NODE_ENV=production (in which case NODE_ENV=development or explicit --production=false would be more reliable).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/react-native-cicd.yml at line 81, The workflow sets
YARN_PRODUCTION: 'false' which may not prevent devDependencies being skipped if
EAS CLI invokes yarn install with NODE_ENV=production; verify EAS CLI's install
behavior and if it calls yarn directly, change the workflow to either set
NODE_ENV: 'development' or add the explicit yarn CLI flag --production=false to
the install step (or ensure EAS uses buildpack-style pruning if you want
YARN_PRODUCTION to apply); look for the CI step that runs yarn install or
invokes EAS CLI and update it to pass --production=false or set NODE_ENV
accordingly.


jobs:
check-skip:
Expand Down
4 changes: 1 addition & 3 deletions src/services/bluetooth-audio.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1491,9 +1491,7 @@ class BluetoothAudioService {
void this.pollReadCharacteristics(deviceId).finally(() => {
this.isReadPollingInFlight = false;
});
// 1500ms interval: reduced from 700ms to lower BLE log spam and CPU overhead
// while still providing sub-2-second PTT button responsiveness
}, 1500);
}, 700);
}

private async pollReadCharacteristics(deviceId: string): Promise<void> {
Expand Down
Loading