Skip to content

fix(msteams): SharePoint file link instead of native file-info card (ENG-14349/ENG-14117) - #59

Merged
convyusboy merged 2 commits into
boonfrom
ridho/eng-14117-msteams-toplevel-plus-filelink
Jul 17, 2026
Merged

convyusboy merged 2 commits into
boonfrom
ridho/eng-14117-msteams-toplevel-plus-filelink

Conversation

@convyusboy

@convyusboy convyusboy commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

Replaces the native Teams file-info card attachment with a markdown link to the shared SharePoint item (📎 [name](shareUrl)) in both msteams send paths:

  • buildActivity (messenger.ts) — inbound-reply attachment path
  • sendMessageMSTeams (send.ts) — proactive/cron send path

Drops the now-unused buildTeamsFileInfoCard / getDriveItemProperties calls and imports.

Why

Bot Framework file-info cards render as a broken "chiclet" (HTTP 400 on file.info) in some tenants — observed live on arguijo (see memory/RCA on the msteams outbound-file 400). A markdown link to the already-shared SharePoint item is reliable across tenants.

This change currently exists only as a host-local dist/ hot-patch on arguijo (applied 2026-07-17). Landing it in fork source means a fork-published @openclaw/msteams (ENG-14431) carries it, so it stops being a per-host edit that a plugin reinstall / fresh standup silently wipes.

Context — the delivery gap this is part of

While deploying the topLevel fix (PR #38, already merged to boon) to arguijo for ENG-14117, we hit the structural problem that @openclaw/msteams is consumed as an external npm package: fork extensions/msteams/src changes never reach a running host until the plugin is rebuilt/reinstalled. arguijo was unblocked today via a fork-built dist/ swap carrying both PR #38 and this file-link change. ENG-14431 (fork-publish msteams) is the durable fix; this PR is a prerequisite so that published package includes the file-send fix.

Test

  • tsc --noEmit on extensions/msteams — clean.
  • vitest run extensions/msteams/src/send.test.ts extensions/msteams/src/send-context.test.ts — 21/21 pass.
  • Live on arguijo: file sends post as 📎 link; no file.info 400.

Follow-ups

  • send.test.ts still mocks buildTeamsFileInfoCard (now dangling) — can be tidied here or in a follow-up.
  • ENG-14431 to fork-publish the package and retire the host-local dist swap.

🤖 Generated with Claude Code


Summary by cubic

Replaced the Teams file-info card with a SharePoint markdown link to avoid the broken “chiclet” (HTTP 400) and make file shares reliable in both replies and proactive/cron sends. This supports proactive delivery for ENG-14117.

  • Bug Fixes

    • Use 📎 [name](shareUrl) instead of a file-info card in buildActivity and sendMessageMSTeams.
  • Refactors

    • Delete graph-chat.ts and remove all buildTeamsFileInfoCard usage and tests; drop getDriveItemProperties calls/imports.

Written for commit 1ad175b. Summary will update on new commits.

Review in cubic

…ard (ENG-14349/ENG-14117)

Bot Framework file-info cards render as a broken "chiclet" (HTTP 400 on
file.info) in some tenants (observed on arguijo). Replace the native file
card attachment with a markdown link to the shared SharePoint item in both
send paths (buildActivity in messenger.ts, sendMessageMSTeams in send.ts),
dropping the now-unused buildTeamsFileInfoCard / getDriveItemProperties calls.

This lands in fork source the host-local dist hot-patch currently applied on
arguijo, so a fork-published @openclaw/msteams (ENG-14431) carries it and it
stops living as a per-host edit that reinstalls silently wipe.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@claude

claude Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

@claude

claude Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

The file-info-card send paths were replaced by SharePoint markdown links in
the prior commit, leaving graph-chat.ts (sole export buildTeamsFileInfoCard)
as unused production code — the check-dependencies CI job (deadcode:unused-files)
flagged it. Delete graph-chat.ts and the now-orphaned test references in
send.test.ts + graph-upload.test.ts.

Verified: tsc --noEmit clean, 30/30 msteams tests pass,
scripts/check-deadcode-unused-files.mjs exits 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>

@gandalfboon gandalfboon 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.

Approved — clean fix.

Ticket trace: ENG-14349/ENG-14117; clear RCA (Bot Framework file.info chiclet → 400 on arguijo).

Why this is right: Converges the SharePoint send path onto the same 📎 [name](shareUrl) markdown-link pattern the OneDrive fallback already used and that's proven reliable across tenants — reducing divergence, not inventing a new shape. Both send paths (buildActivity reply + sendMessageMSTeams proactive/cron) covered consistently.

Verified:

  • uploadAndShareSharePoint and uploadAndShareOneDrive both return { name, shareUrl }, so the template literals are safe — no undefined-in-link risk.
  • graph-chat.ts deletion is clean: no remaining consumers repo-wide, orphaned tests removed, check-dependencies (deadcode) green.
  • tsc clean, 30/30 msteams tests, all CI passing.
  • No secrets, no new authz surface, sharing-scope logic untouched.

Non-blocking nit (already noted as follow-up): send.test.ts still mocks getDriveItemProperties (lines 22/87/189/228) which prod code no longer calls — dead scaffolding, worth a tidy but harmless.

Ship it.

@convyusboy
convyusboy merged commit 253fa3a into boon Jul 17, 2026
139 checks passed
@convyusboy
convyusboy deleted the ridho/eng-14117-msteams-toplevel-plus-filelink branch July 17, 2026 12:16
convyusboy added a commit that referenced this pull request Jul 20, 2026
Version-bump-only correction release boon.4 → boon.5. Ships the fork @openclaw/msteams release asset (#60, ENG-14431) + the msteams SharePoint file-link fix (#59). package.json + msteams package.json/shrinkwrap + root shrinkwrap all pinned to 2026.6.11-boon.5 in lockstep.
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