8000 Decode field name as utf-8 by rohittp0 · Pull Request #8609 · nocodb/nocodb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Decode field name as utf-8 #8609

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

Conversation

rohittp0
Copy link
Contributor

Change Summary

The field names in file attachments were being decoded incorrectly. Added proper UTF-8 decoding to ensure non-english field names are handled properly.

Change type

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

Additional information / screenshots

recording-29_05_2024.webm
8000

Copy link
Contributor
coderabbitai bot commented May 29, 2024
Walkthrough

Walkthrough

The recent update in the PublicDatasService class within public-datas.service.ts enhances the handling of fieldName by encoding it using Buffer.from before applying a regular expression replacement. This change ensures better processing and compatibility of field names, particularly when dealing with different character encodings.

Changes

File Path Change Summary
packages/nocodb/src/services/public-datas.service.ts Updated the fieldName processing to encode file.fieldname using Buffer.from before applying the regex replacement.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant Client
    participant PublicDatasService
    participant FileProcessor

    Client->>PublicDatasService: Upload file with fieldname
    PublicDatasService->>PublicDatasService: Encode fieldname using Buffer.from
    PublicDatasService->>PublicDatasService: Apply regex replacement on encoded fieldname
    PublicDatasService->>FileProcessor: Process file with updated fieldname
    FileProcessor-->>PublicDatasService: Return processing result
    PublicDatasService-->>Client: Return response
Loading

Tip

Early Access Features
  • gpt-4o model for chat

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (4)
packages/nocodb/src/services/public-datas.service.ts (4)

Line range hint 1-1: Use the node: protocol for importing Node.js built-in modules.

- import path from 'path';
+ import path from 'node:path';

Line range hint 29-29: Consider replacing any with more specific types to improve type safety.

Also applies to: 67-67, 97-97, 131-131, 145-145, 176-176, 195-195, 216-216, 228-228, 253-253, 254-254, 290-290, 292-292, 339-339, 426-426, 473-473, 483-483


Line range hint 284-292: Avoid assignments within expressions to enhance code clarity and maintainability.

- data = data = await nocoExecute(
+ data = await nocoExecute(

Line range hint 521-521: Avoid using template literals when not necessary.

- const key = `List`;
+ const key = 'List';
Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 22c3dbc and 8de0397.
Files selected for processing (1)
  • packages/nocodb/src/services/public-datas.service.ts (1 hunks)
Additional Context Used
Biome (20)
packages/nocodb/src/services/public-datas.service.ts (20)

1-1: A Node.js builtin module should be imported with the node: protocol.


29-29: Unexpected any. Specify a different type.


67-67: Unexpected any. Specify a different type.


97-97: Unexpected any. Specify a different type.


131-131: Unexpected any. Specify a different type.


145-145: Unexpected any. Specify a different type.


176-176: Unexpected any. Specify a different type.


195-195: Unexpected any. Specify a different type.


216-216: Unexpected any. Specify a different type.


228-228: Unexpected any. Specify a different type.


253-253: Unexpected any. Specify a different type.


254-254: Unexpected any. Specify a different type.


284-292: The assignment should not be in an expression.


290-290: Unexpected any. Specify a different type.


292-292: Unexpected any. Specify a different type.


339-339: This variable implicitly has the any type.


426-426: Unexpected any. Specify a different type.


473-473: Unexpected any. Specify a different type.


483-483: Unexpected any. Specify a different type.


521-521: Do not use template literals if interpolation and special-character handling are not needed.

Additional comments not posted (1)
packages/nocodb/src/services/public-datas.service.ts (1)

310-312: Properly decode field names using UTF-8.

This change correctly implements the UTF-8 decoding for field names as described in the PR. It should ensure that non-English characters are handled properly.

@dstala dstala requested a review from pranavxc May 30, 2024 06:52
pranavxc
pranavxc approved these changes May 30, 2024
@dstala dstala merged commit 6948eee into develop May 30, 2024
22 of 23 checks passed
@dstala dstala deleted the fix/attachment-in-the-non-english-field-name-causes-error-overload-resolution-failed branch May 30, 2024 13:49
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.

🐛 Bug: attachment in the non-english field name causes error "Overload resolution failed"
3 participants
0