Skip to content

fix(connectors): attribute SharePoint not-found errors to the matched library - #6029

Merged
waleedlatif1 merged 2 commits into
stagingfrom
sharepoint-notfound-library-attribution
Jul 28, 2026
Merged

fix(connectors): attribute SharePoint not-found errors to the matched library#6029
waleedlatif1 merged 2 commits into
stagingfrom
sharepoint-notfound-library-attribution

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #6026, fixing a Cursor Bugbot finding that was reported before that PR merged but landed unfixed.

  • When the first path segment named a real non-default document library but the remainder did not resolve there, buildFolderNotFoundMessage described a search of the default library over the full original path
  • It also advised stripping a leading Documents / Shared Documents prefix — actively wrong when the user had correctly supplied a library name
  • Now reports against the library that was matched, over the remainder actually searched, and only offers the prefix hint when the default library really was the one searched

Concretely: Policies/HR, where Policies is a real library and HR is not in it, previously reported document library "Documents" and path "Policies/HR" and listed the wrong library's folders. It now names Policies, the path HR, and lists that library's folders.

Diagnostics only — no change to which folder resolves.

Type of Change

  • Bug fix

Testing

Added a regression test asserting the message names the matched library, its remainder, and its folder names, and contains neither the default library name nor the prefix hint. 23 connector tests pass; typecheck and lint clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

… library

When the first path segment named a real non-default document library but the
remainder did not resolve there, the failure message described a search of the
default library over the full original path, and advised stripping a library
prefix the user had supplied correctly.

Report against the library that was matched, over the remainder that was
actually searched, and only suggest omitting a leading library name when the
default library really was the one searched.
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 28, 2026 11:43pm

Request Review

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Diagnostics-only change in the SharePoint connector; folder resolution logic is untouched.

Overview
Fixes misleading SharePoint folder-not-found diagnostics when the first path segment matches a non-default document library but the rest of the path does not resolve there. Resolution behavior is unchanged; only error text and which library’s folders are listed.

resolveFolderTarget now builds the failure from the matched library and its remainder (Policies + HR for Policies/HR), instead of the default library and the full path. buildFolderNotFoundMessage takes a searchedDefaultLibrary flag so the “omit Documents / Shared Documents prefix” hint appears only when the default library was actually searched.

Regression tests cover the matched-library case and confirm the prefix hint still appears for paths like Shared Documents/Reports.

Reviewed by Cursor Bugbot for commit 01a136d. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes SharePoint folder not-found diagnostics so they attribute the matched library and remainder path, and only suggest stripping a Documents/Shared Documents prefix when the default library was actually searched.

  • resolveFolderTarget reports against libraryMatch (or the default drive) with the segments that were searched
  • buildFolderNotFoundMessage takes searchedDefaultLibrary to gate the prefix hint
  • Regression tests cover matched-library blame and retained default-library prefix advice

Confidence Score: 5/5

This PR appears safe to merge; no blocking failures remain from the current change set or prior review findings available in this session.

No blocking failure remains. The update only corrects diagnostic attribution and when the prefix-stripping hint is shown; resolution behavior is unchanged and covered by new tests.

Important Files Changed

Filename Overview
apps/sim/connectors/sharepoint/sharepoint.ts Attributes not-found errors to the matched library and remainder path; gates the Documents/Shared Documents prefix hint on default-library search.
apps/sim/connectors/sharepoint/sharepoint.test.ts Adds regression coverage for matched-library blame and default-library prefix-hint behavior.

Reviews (2): Last reviewed commit: "fix(connectors): key the library-prefix ..." | Re-trigger Greptile

Comment thread apps/sim/connectors/sharepoint/sharepoint.ts Outdated
…searched

Deriving the flag from `!libraryMatch` suppressed the hint when the path named
the default library itself ("Documents/Reports"), which is exactly the case the
hint exists for. Key it on whether the reported drive is the default library.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 01a136d. Configure here.

@waleedlatif1
waleedlatif1 merged commit dc94879 into staging Jul 28, 2026
15 checks passed
@waleedlatif1
waleedlatif1 deleted the sharepoint-notfound-library-attribution branch July 28, 2026 23:47
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.

1 participant