Page MenuHomePhabricator

[Cashtab] Prevent double notifications on send xec txs while preserving testing of component tx building
ClosedPublic

Authored by bytesofman on Thu, Jan 16, 13:45.

Details

Summary

Cashtab has better and standardized tx notifications that come from the websocket subscription. However, it is still important to test correct rawtxs are built in the component screens. We are not able to test the websocket tx notifications without regtest, but we can test the tx notifications generated by the components.

So, we conditionally render these notifications only in the test environment.

Test Plan

npm test, npm start and send some eCash, we do not see double notifications on send

Diff Detail

Repository
rABC Bitcoin ABC
Branch
no-double-notifications
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32121
Build 63733: Build Diffcashtab-tests
Build 63732: arc lint + arc unit

Event Timeline

make the "toast if test" function portable, implement for token notifications

Tail of the build log:

> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 364 packages, and audited 367 packages in 2s

60 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.3.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1494 packages, and audited 3315 packages in 25s

320 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (6 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.12.0 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2554: Expected 1 arguments, but got 2.
    680 |                         : 'eToken sent'}
    681 |                 </a>,
  > 682 |                 {
        |                 ^
  > 683 |                     icon: <TokenIcon size={32} tokenId={tokenId} />,
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  > 684 |                 },
        | ^^^^^^^^^^^^^^^^^^
    685 |             );
    686 |             clearInputForms();
    687 |             // Hide the confirmation modal if it was showing


Build cashtab-tests failed with exit code 1

Tail of the build log:

> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 364 packages, and audited 367 packages in 2s

60 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.3.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1494 packages, and audited 3315 packages in 25s

320 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (6 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.12.0 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2554: Expected 1 arguments, but got 2.
    798 |                     eCash sent
    799 |                 </a>,
  > 800 |                 {
        |                 ^
  > 801 |                     icon: CashReceivedNotificationIcon,
        | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  > 802 |                 },
        | ^^^^^^^^^^^^^^^^^^
    803 |             );
    804 |
    805 |             clearInputForms();


Build cashtab-tests failed with exit code 1

Tail of the build log:

  npm audit fix

Run `npm audit` for details.

> ecash-lib@1.3.0 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 364 packages, and audited 367 packages in 2s

60 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.3.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1494 packages, and audited 3315 packages in 25s

320 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (6 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.12.0 build
> node scripts/build.js

Creating an optimized production build...

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

[eslint] 
src/components/Send/SendXec.tsx
  Line 8:10:  'CashReceivedNotificationIcon' is defined but never used  @typescript-eslint/no-unused-vars


Build cashtab-tests failed with exit code 1
This revision is now accepted and ready to land.Thu, Jan 16, 19:56