Skip to content

Commit b438aa3

Browse files
committed
Sync fixes
1 parent d8f07cd commit b438aa3

11 files changed

Lines changed: 333 additions & 301 deletions

File tree

.changeset/better-houses-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@plotday/tool-linear": patch
3+
---
4+
5+
Changed: Updated Linear SDK

.changeset/quick-pillows-fetch.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@plotday/tool-asana": patch
3+
"@plotday/tool-jira": patch
4+
---
5+
6+
Fixed: Always use event IDs rather than URL for source

.changeset/upset-towns-sink.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@plotday/tool-outlook-calendar": patch
3+
"@plotday/tool-google-calendar": patch
4+
---
5+
6+
Fixed: Always use event IDs rather than URL for source

pnpm-lock.yaml

Lines changed: 7 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/asana/src/asana.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,10 @@ export class Asana extends Tool<Asana> implements ProjectTool {
388388
description = task.notes;
389389
}
390390

391-
// Construct Asana task URL
391+
// Use stable identifier for source
392+
const activitySource = `asana:task:${task.gid}`;
393+
394+
// Construct Asana task URL for link
392395
const taskUrl = `https://app.asana.com/0/${projectId}/${task.gid}`;
393396

394397
// Create initial note with description and link to Asana task
@@ -400,15 +403,15 @@ export class Asana extends Tool<Asana> implements ProjectTool {
400403
});
401404

402405
notes.push({
403-
activity: { source: taskUrl },
406+
activity: { source: activitySource },
404407
key: "description",
405408
content: description,
406409
created: task.created_at ? new Date(task.created_at) : undefined,
407410
links: links.length > 0 ? links : null,
408411
});
409412

410413
return {
411-
source: taskUrl,
414+
source: activitySource,
412415
type: ActivityType.Action,
413416
title: task.name,
414417
created: task.created_at ? new Date(task.created_at) : undefined,
@@ -647,8 +650,8 @@ export class Asana extends Tool<Asana> implements ProjectTool {
647650
};
648651
}
649652

650-
// Construct task URL
651-
const taskUrl = `https://app.asana.com/0/${projectId}/${task.gid}`;
653+
// Use stable identifier for source
654+
const activitySource = `asana:task:${task.gid}`;
652655

653656
// Extract description
654657
let description: string | null = null;
@@ -658,7 +661,7 @@ export class Asana extends Tool<Asana> implements ProjectTool {
658661

659662
// Create partial activity update (no notes = doesn't touch existing notes)
660663
const activity: NewActivity = {
661-
source: taskUrl,
664+
source: activitySource,
662665
type: ActivityType.Action,
663666
title: task.name,
664667
created: task.created_at ? new Date(task.created_at) : undefined,
@@ -695,8 +698,8 @@ export class Asana extends Tool<Asana> implements ProjectTool {
695698
const taskGid = event.resource.gid;
696699

697700
try {
698-
// Construct task URL
699-
const taskUrl = `https://app.asana.com/0/${projectId}/${taskGid}`;
701+
// Use stable identifier for source
702+
const activitySource = `asana:task:${taskGid}`;
700703

701704
// Fetch stories (comments) for this task
702705
// We fetch all stories since Asana doesn't provide the specific story GID in the webhook
@@ -733,19 +736,23 @@ export class Asana extends Tool<Asana> implements ProjectTool {
733736

734737
// Create activity update with single story note
735738
const activity: NewActivityWithNotes = {
736-
source: taskUrl,
739+
source: activitySource,
737740
type: ActivityType.Action, // Required field (will match existing activity)
738741
notes: [
739742
{
740743
key: `story-${latestStory.gid}`,
741-
activity: { source: taskUrl },
744+
activity: { source: activitySource },
742745
content: latestStory.text || "",
743746
created: latestStory.created_at
744747
? new Date(latestStory.created_at)
745748
: undefined,
746749
author: storyAuthor,
747750
} as NewNote,
748751
],
752+
meta: {
753+
taskGid,
754+
projectId,
755+
},
749756
};
750757

751758
await this.tools.callbacks.run(callbackToken, activity);

0 commit comments

Comments
 (0)