-
Notifications
You must be signed in to change notification settings - Fork 40
Next #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Next #676
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added `change-case.test.ts` in `src/utils/__test__/` to test `paramCase` and `snakeCase` utility functions. - Verified handling of spaces, special characters, case conversion, and edge cases. - Included snapshot testing for various inputs. - Generated corresponding snapshot file `change-case.test.ts.snap` to validate consistent outputs.
- Added tests for `handleNotification` in `events.test.ts` to ensure: - Correct dispatch of `appendNotification` when `profileId` matches receiver. - No dispatch when `profileId` does not match or dispatch is not provided. - Accurate creation of `onMarkAsRead` function for notifications. - Added tests for `handleEvents` to verify: - Correct handler invocation based on event type. - Proper handling when event type or payload is missing or unknown. - Verified `eventsHandlersMap` contains the `NOTIFICATION` handler.
Cleaned up unused imports from the change-case.test.ts file. - Removed `describe`, `it`, and `expect` imports from 'vitest'. This ensures the file only contains necessary imports, reducing clutter.
- Added test cases in `flatten-array.test.ts` to validate: - Handling of nested, deeply nested, and custom-key arrays. - Responses for edge cases like empty arrays and arrays with no or empty children. - Preservation of all object properties during flattening. - Behavior with null and undefined inputs. - Snapshot testing for various input scenarios. - Included generated snapshot file in `__snapshots__/flatten-array.test.ts.snap`.
Added comprehensive test cases for the `format-time` utility functions. - `src/utils/__test__/format-time.test.ts`: - Added test cases for `fDate`, `fDateTime`, `fTimestamp`, and `fToNow`. - Verified outputs, edge cases (null/undefined), and snapshot tests. - `src/utils/__test__/__snapshots__/format-time.test.ts.snap`: - Generated snapshot files to ensure consistent output for various test cases.
- Created `highlight.test.ts` to validate highlight.js utils. - Mocked `highlight.js` and its styles for testing. - Verified `highlight.js` configuration with correct languages. - Ensured `window.hljs` is set when `window` is defined. - Tested highlighting different supported languages successfully. - Added tests for language auto-detection with `highlightAuto`. - Checked behavior when `window` is undefined (no `hljs` set).
- `errors.test.ts`: - Verified the `ERROR_MESSAGES` object for completeness, format, and consistency. - Added specific tests to validate placeholder logic and message correctness. - Included snapshot testing for error messages. - `info.test.ts`: - Tested `INFO_MESSAGES` for all keys and placeholders using snapshots. - Ensured consistency in deposit, withdraw, and approval-related info messages. - Validated template patterns and confirmation phrases. - `internal-notifications.test.ts`: - Covered notification methods (`notifyError`, `notifySuccess`, etc.) comprehensively. - Included tests for fallback messages and template tag replacements. - Verified notifier options and edge cases when global notifier is not set. - `success.test.ts`: - Ensured `SUCCESS_MESSAGES` structure, placeholders, and consistency via unit and snapshot tests. - `warning.test.ts`: - Validated `WARNING_MESSAGES` comprehensiveness, format, and absence of placeholders. - Tested consistency in wallet- and amount-related warnings. - Added snapshots for `errors`, `info`, `success`, and `warning` messages.
- Moved `ipfs.ts` from `src/utils` to `src/libs` for better organization. - Updated imports in the following files to reflect the new path: - `src/hooks/use-submit-assets-to-lens.ts` - `src/components/login-modal/profile-form-view.tsx` - `src/workers/backgroundTaskWorker.ts` - `src/sections/publication/components/publication-details-comment-form.tsx`
- Moved common interfaces and types from multiple files: - Consolidated 'ProcessedTransactionData', 'Transaction', 'EventName', and others into 'src/libs/types.ts'. - Adjusted imports and updated relevant files: - 'groupedTransactions.ts' now imports Transaction-related types. - 'internal-notifications.ts' references 'NotificationType' and 'NotificationOptions' from the centralized types. - 'carousel/index.ts' relies on 'CalculateItemsPerSlideProps' from the consolidated types. - 'ipfs.ts' uses 'PinataHeaders', 'PinataResponse', 'IPFSMetadata' from the shared types file. - Removed duplicate type definitions and improved maintainability.
# Conflicts: # src/App.tsx # src/components/follow-unfollow-button.tsx # src/components/login-modal/profile-form-view.tsx # src/components/login-modal/profile-select-view.tsx # src/components/subscribe-profile-modal.tsx # src/hooks/protocol/use-authorize-policy.ts # src/hooks/protocol/use-configure-campaign.ts # src/hooks/protocol/use-create-campaign.ts # src/hooks/protocol/use-deposit.ts # src/hooks/protocol/use-has-access.ts # src/hooks/protocol/use-register-asset.ts # src/hooks/protocol/use-sponsored-access-agreement.ts # src/hooks/protocol/use-subscribe.ts # src/hooks/protocol/use-transfer-asset.ts # src/sections/finance/components/finance-invite-friends.tsx # src/sections/finance/views/finance-view.tsx # src/sections/marketing/components/campaign-settings-modal-content.tsx # src/sections/ownership/components/ownership-process.tsx # src/sections/publication/components/publication-details-comment-form.tsx # src/sections/user/views/user-profile-view.tsx
- Add a new `IPFSError` class for standardized error representation in `src/libs/ipfs.ts`. - Update all error handling to use `IPFSError`, providing better context for debugging: - Modify `uploadToIPFS` to throw `IPFSError` on failures. - Enhance error handling in `uploadImageToIPFS`, `uploadImagesToIPFS`, `uploadMetadataToIPFS`, and `verifyIPFSData`. - Ensure original errors are preserved and logged with meaningful messages.
…fallback logic - Introduced `TemplateValue` type to simplify and standardize type definitions across functions in `internal-notifications.ts`. - Replaced logical OR (`||`) with nullish coalescing (`??`) in fallback message handling for improved clarity and safety. - Updated all affected functions (`notify`, `notifyError`, `notifySuccess`, `notifyWarning`, `notifyInfo`) to use the new `TemplateValue` type and adjusted fallback logic.
- Updated `src/libs/storage-available.ts` to use the nullish coalescing operator (??) instead of the logical OR operator (||). - This ensures that falsy values like 0 or empty strings are not mistakenly replaced by the default value.
- Added a `SupabaseError` class to standardize error handling across `supabase-actions.ts`. - Updated all functions to use `SupabaseError` for capturing and throwing errors. - Enhanced error logging with `console.error` to clarify and standardize output.
- Introduced `createSupabaseError` utility in `src/libs/supabase-actions.ts` to standardize error handling. - Replaced repetitive error handling code in various functions with `createSupabaseError`. - Affected functions include `fetchInvitations`, `checkPendingInvitations`, `acceptInvitation`, `checkInvitationStatus`, `checkAcceptedInvitations`, `sendInvitation`, `acceptOrCreateInvitation`, and `checkInvitedStatus`. This change reduces duplicated code, improves readability, and ensures consistency.
- `src/components/__test__/modal.test.tsx`: Updated comment for a specific TypeScript error. - `src/components/markdown/markdown.tsx`: Improved typing with `PropsWithChildren` and removed unused variables. - `src/components/video-player/video-player.tsx`: Replaced `@ts-ignore` with `@ts-expect-error` and fixed comment formatting. - Updated all instances across components and hooks to replace `@ts-ignore` with `@ts-expect-error` for improved TypeScript error handling, including: - Various test files (`types.test.tsx`, `setupTest.tsx`). - Redux-related files (`notifications`, `nav-toggle-button`). - UI components (`carousel`, `header-balance`, `login-modal`, `dashboard layout`, etc.).
- Extracted `TableHeadCustomProps` from `table-head-custom.tsx` and moved it to `types.ts`. - Added `HeadLabel` interface to define the structure of head label objects. - Updated imports in `table-head-custom.tsx` to reference new type definitions. This improves code organization and reusability by consolidating type definitions into one location.
- Removed unnecessary comments at the top of the file. - Updated `getComparator` to use a generic type `T` instead of a constrained key type for improved flexibility. - Adjusted comparator function signatures for clarity and broader applicability.
- Updated `style` prop type to `CSSProperties` for better type safety in `src/components/watchit-loader/index.tsx`. - Added a default empty object fallback for `style` prop when undefined.
- Updated type casting for `profileImage` and `backgroundImage` in `modal.tsx` to use `ProfilePictureSet` for improved type safety. - Added a `@ts-expect-error` comment to suppress type checking where necessary.
- Added `@ts-expect-error` to suppress false type error on `ProfilePictureSet` import in `src/components/user-item/index.tsx`. - Explicitly specified `Profile` type for `profile` variable to improve clarity and type safety. - Refined `AvatarProfile` usage by casting `profile?.metadata?.picture` as `ProfilePictureSet`. - Added type assertions for `address` and `displayName` to enforce stricter type checking in `UserNameAndBadge`.
- `use-typography.ts`: Refactored `getFont` function to improve readability, extracting font properties explicitly and aligning with `FontProperties`. Adjusted `lineHeight` computation to use extracted values. Removed redundant imports. - `types.ts`: Added the `FontProperties` interface to define typing for font property objects, enhancing type safety and maintainability.
- Added a `@ts-expect-error` directive to suppress type error related to `ProfilePictureSet` import in `subscribe-profile-modal.tsx`. - Changed type casting for `profile.metadata.picture` to `ProfilePictureSet` for proper handling in the `avatar` field. These changes ensure type safety and eliminate potential runtime errors.
- Removed unnecessary @ts-expect-error annotation in `activate-subscription-profile-modal.tsx` as it was not required. - Updated `catch` block to log detailed error messages for better debugging.
- Updated `Hls.Events.ERROR` handler to use `ErrorData` type in `video-player.tsx`. - Added a `@ts-expect-error` comment to suppress the type mismatch warning in the context of event handling.
- Replace `any` with `NeonPaperProps` in `neonPaperProps` for stricter typing in `sponsored-access-button/types.ts`. - Improve type safety and consistency by using specific imported types.
Jadapema
approved these changes
May 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
feat: adapt the new api changes (with auth)
fix: issues reported
fix: follow issue
fix: migration from lens issues
fix: subscription campaign error
feat: connect xp balance
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.