Skip to content
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

Fix cursor generation buffer dependency in front #9101

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

charlesBochet
Copy link
Member

@charlesBochet charlesBochet commented Dec 17, 2024

Buffer is part of nodejs API and is not recognized by front js runner. buffer library (already installed) is providing a polyfill for that

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Implemented explicit Buffer import from 'buffer' package to fix cursor generation in the frontend, ensuring proper base64 encoding/decoding of record data.

  • Added explicit Buffer import from 'buffer' package in /packages/twenty-front/src/modules/apollo/utils/encodeCursor.ts
  • Enhanced cursor payload structure to handle both id and optional position fields
  • Added comprehensive test coverage in encodeCursor.test.ts for various cursor generation scenarios
  • Implemented error handling for records without required id field

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@charlesBochet charlesBochet merged commit 8bb699c into main Dec 17, 2024
18 checks passed
@charlesBochet charlesBochet deleted the fix-buffer-usage-frontend branch December 17, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants