Skip to content

fix: truncate tagToString to max filename len #5632

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 5 commits into from
May 16, 2025
Merged

Conversation

Patrick-Erichsen
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen commented May 12, 2025

Description

Resolves #5594


Summary by mrge

Updated the tagToString function to truncate long strings, making sure table names and identifiers stay within safe filename limits. This prevents errors from overly long paths, especially in dev containers.

@Patrick-Erichsen Patrick-Erichsen requested a review from a team as a code owner May 12, 2025 18:28
@Patrick-Erichsen Patrick-Erichsen requested review from tomasz-stefaniak and removed request for a team May 12, 2025 18:28
Copy link

netlify bot commented May 12, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit d56201c
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/6822a1d0e38fa100084eefa0

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 12, 2025
@Patrick-Erichsen
Copy link
Collaborator Author

@sestinj I don't believe this should break any existing indexes since it only uses the new logic if the tagName would have thrown an error using the old logic. But worth a sanity check.

@Patrick-Erichsen Patrick-Erichsen requested review from sestinj and removed request for tomasz-stefaniak May 12, 2025 18:31
Copy link
Contributor

@sestinj sestinj left a comment

Choose a reason for hiding this comment

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

  • tests
  • trim from end instead of start
  • move the constant

@@ -4,7 +4,7 @@ import { RunResult } from "sqlite3";

import { IContinueServerClient } from "../../continueServer/interface.js";
import { Chunk, IndexTag, IndexingProgressUpdate } from "../../index.js";
import { DatabaseConnection, SqliteDb, tagToString } from "../refreshIndex.js";
import { DatabaseConnection, SqliteDb } from "../refreshIndex.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

nothing to do in your PR here, but reminder that we should add prettier as a CI step to resolve these messy diffs

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs May 12, 2025
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels May 13, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs May 15, 2025
@github-project-automation github-project-automation bot moved this from Done to In Progress in Issues and PRs May 15, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 16, 2025
@RomneyDa RomneyDa dismissed sestinj’s stale review May 16, 2025 20:02

Has been fixed

@RomneyDa RomneyDa merged commit be4e6ae into main May 16, 2025
106 of 117 checks passed
@RomneyDa RomneyDa deleted the pe/tagToString-fix branch May 16, 2025 20:02
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs May 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Indexing failed: File name too long
3 participants