You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Lit JS SDK at commit 412264b and beyond (master / branches after PR #579 ).
Lit Network
Datil / or whichever network you’re using (if applicable).
Description of the bug/issue
After the refactoring in PR #579 , the LogLevel enum was supposed to be replaced by LOG_LEVEL constants from @lit-protocol/constants. However, subsequent merges caused a partial rollback (ancestor revert):
Commit: Merge branch 'master' into staging/v7 on Oct 3, 2024, reintroduced LogLevel references while also removing export { LOG_LEVEL }; in logger.ts.
This mismatch led to failing tests (TypeScript errors and incorrect timestamp comparisons), as well as confusion around whether LogLevel or LOG_LEVEL should be used.
Currently logger test fails with the error
npx nx run logger:test --coverage
:
FAIL logger packages/logger/src/lib/logger.spec.ts
● Test suite failed to run
packages/logger/src/lib/logger.spec.ts:1:10 - error TS2724: '"./logger"' has no exported member named 'LOG_LEVEL'. Did you mean 'LogLevel'?
1 import { LOG_LEVEL, LogManager } from './logger';
We want to keep the code aligned with the overall project direction—to unify everything under LOG_LEVEL—but also maintain backwards compatibility in the short term (e.g., ensuring both LogLevel and LOG_LEVEL references don’t break the build).
Severity of the bug
Medium: The logger tests fail out-of-the-box, causing confusion and blocking straightforward usage or contributions in the logger package.
Steps To Reproduce
In this environment (Node.js v20, Nx 17.x, etc.), check out the master or staging/v7 branch at or after commit c8801c5fe87cacee7....
Run npx nx run logger:test --coverage or yarn tools --test --unit (depending on your setup).
See TypeScript errors:
npx nx run logger:test --coverage
:
FAIL logger packages/logger/src/lib/logger.spec.ts
● Test suite failed to run
packages/logger/src/lib/logger.spec.ts:1:10 - error TS2724: '"./logger"' has no exported member named 'LOG_LEVEL'. Did you mean 'LogLevel'?
1 import { LOG_LEVEL, LogManager } from './logger';
Or find that tests referencing LogLevel fail if the code exports only LOG_LEVEL, etc.
Reintroduce export { LOG_LEVEL } in logger.ts, ensuring backward compatibility for any remaining references to LogLevel.
Update the tests to consistently use LOG_LEVEL.DEBUG (etc.) instead of LogLevel.DEBUG, or vice-versa if the old enum is still needed.
Ultimately unify everything under LOG_LEVEL per the original refactor’s intent.
Context
I tested a local branch that modifies logger.spec.ts to rely fully on LOG_LEVEL, while still exporting both LOG_LEVEL and LogLevel for backward compatibility.
After these changes, npx nx run logger:test --coverage passes with no TS errors and the test that checks creation timestamps is fixed to compare numeric vs. string properly.
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
SDK version
Using Lit JS SDK at commit 412264b and beyond (master / branches after PR #579 ).
Lit Network
Datil / or whichever network you’re using (if applicable).
Description of the bug/issue
After the refactoring in PR #579 , the
LogLevel
enum was supposed to be replaced byLOG_LEVEL
constants from@lit-protocol/constants
. However, subsequent merges caused a partial rollback (ancestor revert):LogLevel
references while also removingexport { LOG_LEVEL };
inlogger.ts
.LogLevel
orLOG_LEVEL
should be used.Currently logger test fails with the error
We want to keep the code aligned with the overall project direction—to unify everything under
LOG_LEVEL
—but also maintain backwards compatibility in the short term (e.g., ensuring bothLogLevel
andLOG_LEVEL
references don’t break the build).Severity of the bug
Medium: The logger tests fail out-of-the-box, causing confusion and blocking straightforward usage or contributions in the
logger
package.Steps To Reproduce
master
orstaging/v7
branch at or after commitc8801c5fe87cacee7...
.npx nx run logger:test --coverage
oryarn tools --test --unit
(depending on your setup).Or find that tests referencing
LogLevel
fail if the code exports onlyLOG_LEVEL
, etc.Link to code
packages/logger/src/lib/logger.ts
andpackages/logger/src/lib/logger.spec.ts
https://github.com/LIT-Protocol/js-sdk/blob/master/packages/logger/src/lib/logger.spec.ts#L1Anything else?
Proposed fix
export { LOG_LEVEL }
inlogger.ts
, ensuring backward compatibility for any remaining references toLogLevel
.LOG_LEVEL.DEBUG
(etc.) instead ofLogLevel.DEBUG
, or vice-versa if the old enum is still needed.LOG_LEVEL
per the original refactor’s intent.Context
logger.spec.ts
to rely fully onLOG_LEVEL
, while still exporting bothLOG_LEVEL
andLogLevel
for backward compatibility.npx nx run logger:test --coverage
passes with no TS errors and the test that checks creation timestamps is fixed to compare numeric vs. string properly.The text was updated successfully, but these errors were encountered: