@sentry/junior 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ import {
12
12
  import { after } from "next/server";
13
13
  import * as Sentry from "@sentry/nextjs";
14
14
  async function loadBot() {
15
- const { bot } = await import("./bot-Y6A47LEZ.js");
15
+ const { bot } = await import("./bot-PFLNB5PC.js");
16
16
  return bot;
17
17
  }
18
18
  async function POST(request, context) {
@@ -4,7 +4,7 @@ import {
4
4
  downloadPrivateSlackFile,
5
5
  getThreadMessageTopic,
6
6
  removeReactionFromMessage
7
- } from "./chunk-RFUE5VBK.js";
7
+ } from "./chunk-3ENACZ27.js";
8
8
  import {
9
9
  acquireQueueMessageProcessingOwnership,
10
10
  completeQueueMessageProcessingOwnership,
@@ -12,7 +12,7 @@ import {
12
12
  getQueueMessageProcessingState,
13
13
  getStateAdapter,
14
14
  refreshQueueMessageProcessingOwnership
15
- } from "./chunk-OZFXD5IG.js";
15
+ } from "./chunk-BKYYVLVN.js";
16
16
  import {
17
17
  createRequestContext,
18
18
  logError,
@@ -145,6 +145,36 @@ async function processQueuedThreadMessage(payload, deps = defaultProcessQueuedTh
145
145
  thread: deserializeThread(payload.thread),
146
146
  message: deserializeMessage(payload.message)
147
147
  };
148
+ let reactionCleared = false;
149
+ const clearProcessingReaction = async () => {
150
+ if (reactionCleared) {
151
+ return;
152
+ }
153
+ reactionCleared = true;
154
+ try {
155
+ await deps.clearProcessingReaction({
156
+ channelId: runtimePayload.thread.channelId,
157
+ timestamp: runtimePayload.message.id
158
+ });
159
+ } catch (error) {
160
+ const errorMessage = error instanceof Error ? error.message : String(error);
161
+ deps.logWarn(
162
+ "queue_processing_reaction_clear_failed",
163
+ {
164
+ slackThreadId: payload.normalizedThreadId,
165
+ slackChannelId: getPayloadChannelId(payload),
166
+ slackUserId: getPayloadUserId(payload)
167
+ },
168
+ {
169
+ "messaging.message.id": payload.message.id,
170
+ "app.queue.message_kind": payload.kind,
171
+ "app.queue.message_id": payload.queueMessageId,
172
+ "error.message": errorMessage
173
+ },
174
+ "Failed to remove processing reaction after queue turn completion"
175
+ );
176
+ }
177
+ };
148
178
  try {
149
179
  const refreshed = await refreshQueueMessageProcessingOwnership({
150
180
  rawKey: payload.dedupKey,
@@ -154,42 +184,12 @@ async function processQueuedThreadMessage(payload, deps = defaultProcessQueuedTh
154
184
  if (!refreshed) {
155
185
  throw new QueueMessageOwnershipError("refresh", payload.dedupKey);
156
186
  }
157
- let reactionCleared = false;
158
- const clearReactionBeforeFirstResponsePost = async () => {
159
- if (reactionCleared) {
160
- return;
161
- }
162
- reactionCleared = true;
163
- try {
164
- await deps.clearProcessingReaction({
165
- channelId: runtimePayload.thread.channelId,
166
- timestamp: runtimePayload.message.id
167
- });
168
- } catch (error) {
169
- const errorMessage = error instanceof Error ? error.message : String(error);
170
- deps.logWarn(
171
- "queue_processing_reaction_clear_failed",
172
- {
173
- slackThreadId: payload.normalizedThreadId,
174
- slackChannelId: getPayloadChannelId(payload),
175
- slackUserId: getPayloadUserId(payload)
176
- },
177
- {
178
- "messaging.message.id": payload.message.id,
179
- "app.queue.message_kind": payload.kind,
180
- "app.queue.message_id": payload.queueMessageId,
181
- "error.message": errorMessage
182
- },
183
- "Failed to remove processing reaction before sending queue response"
184
- );
185
- }
186
- };
187
187
  await deps.processRuntime({
188
188
  kind: runtimePayload.kind,
189
189
  thread: runtimePayload.thread,
190
- message: runtimePayload.message,
191
- beforeFirstResponsePost: clearReactionBeforeFirstResponsePost
190
+ message: runtimePayload.message
192
191
  });
192
+ await clearProcessingReaction();
193
193
  const completed = await completeQueueMessageProcessingOwnership({
194
194
  rawKey: payload.dedupKey,
195
195
  ownerToken,
@@ -200,6 +200,7 @@ async function processQueuedThreadMessage(payload, deps = defaultProcessQueuedTh
200
200
  }
201
201
  } catch (error) {
202
202
  const errorMessage = error instanceof Error ? error.message : String(error);
203
+ await clearProcessingReaction();
203
204
  await logThreadMessageFailure(payload, errorMessage);
204
205
  const failed = await failQueueMessageProcessingOwnership({
205
206
  rawKey: payload.dedupKey,
@@ -1,7 +1,10 @@
1
1
  import {
2
2
  disconnectStateAdapter,
3
+ getPluginProviders,
4
+ getPluginRuntimeDependencies,
5
+ getPluginRuntimePostinstall,
3
6
  resolveRuntimeDependencySnapshot
4
- } from "../chunk-OZFXD5IG.js";
7
+ } from "../chunk-BKYYVLVN.js";
5
8
  import "../chunk-PY4AI2GZ.js";
6
9
  import "../chunk-Z5E25LRN.js";
7
10
 
@@ -23,10 +26,63 @@ function progressMessage(phase) {
23
26
  }
24
27
  return "Sandbox snapshot build complete.";
25
28
  }
29
+ function formatList(values) {
30
+ return values.length > 0 ? values.join(", ") : "none";
31
+ }
32
+ function logSnapshotProfile(log) {
33
+ const providers = getPluginProviders();
34
+ const pluginNames = providers.map((plugin) => plugin.manifest.name).sort();
35
+ const snapshotPluginNames = providers.filter(
36
+ (plugin) => (plugin.manifest.runtimeDependencies?.length ?? 0) > 0 || (plugin.manifest.runtimePostinstall?.length ?? 0) > 0
37
+ ).map((plugin) => plugin.manifest.name).sort();
38
+ const systemDependencies = [];
39
+ const npmDependencies = [];
40
+ for (const dep of getPluginRuntimeDependencies()) {
41
+ if (dep.type === "npm") {
42
+ npmDependencies.push(`${dep.package}@${dep.version}`);
43
+ continue;
44
+ }
45
+ systemDependencies.push("package" in dep ? dep.package : dep.url);
46
+ }
47
+ const postinstallCommands = getPluginRuntimePostinstall().map(
48
+ ({ cmd, args }) => [cmd, ...args ?? []].filter((part) => part.trim().length > 0).join(" ")
49
+ );
50
+ log(`Loaded plugins (${pluginNames.length}): ${formatList(pluginNames)}`);
51
+ log(
52
+ "Sandbox snapshot inputs: " + [
53
+ `plugins=${snapshotPluginNames.length}`,
54
+ `system_dependencies=${systemDependencies.length}`,
55
+ `npm_dependencies=${npmDependencies.length}`,
56
+ `postinstall_commands=${postinstallCommands.length}`
57
+ ].join(" ")
58
+ );
59
+ if (snapshotPluginNames.length === 0 && systemDependencies.length === 0 && npmDependencies.length === 0 && postinstallCommands.length === 0) {
60
+ return;
61
+ }
62
+ log(
63
+ `Snapshot plugins (${snapshotPluginNames.length}): ${formatList(snapshotPluginNames)}`
64
+ );
65
+ if (systemDependencies.length > 0) {
66
+ log(
67
+ `System dependencies (${systemDependencies.length}): ${systemDependencies.join(", ")}`
68
+ );
69
+ }
70
+ if (npmDependencies.length > 0) {
71
+ log(
72
+ `NPM dependencies (${npmDependencies.length}): ${npmDependencies.join(", ")}`
73
+ );
74
+ }
75
+ if (postinstallCommands.length > 0) {
76
+ log(
77
+ `Runtime postinstall (${postinstallCommands.length}): ${postinstallCommands.join(", ")}`
78
+ );
79
+ }
80
+ }
26
81
  async function runSnapshotCreate(log = console.log) {
27
82
  const runtime = DEFAULT_RUNTIME;
28
83
  const timeoutMs = DEFAULT_TIMEOUT_MS;
29
84
  try {
85
+ logSnapshotProfile(log);
30
86
  const emitted = /* @__PURE__ */ new Set();
31
87
  const snapshot = await resolveRuntimeDependencySnapshot({
32
88
  runtime,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  POST
3
- } from "../chunk-DGKNXMK4.js";
4
- import "../chunk-RFUE5VBK.js";
5
- import "../chunk-OZFXD5IG.js";
3
+ } from "../chunk-WM5Z766B.js";
4
+ import "../chunk-3ENACZ27.js";
5
+ import "../chunk-BKYYVLVN.js";
6
6
  import "../chunk-PY4AI2GZ.js";
7
7
  import "../chunk-Z5E25LRN.js";
8
8
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  POST as POST2
3
- } from "../chunk-TEQ3UIS7.js";
3
+ } from "../chunk-ECEC25CR.js";
4
4
  import {
5
5
  POST
6
- } from "../chunk-DGKNXMK4.js";
6
+ } from "../chunk-WM5Z766B.js";
7
7
  import {
8
8
  escapeXml,
9
9
  formatProviderLabel,
@@ -13,7 +13,7 @@ import {
13
13
  publishAppHomeView,
14
14
  resolveBaseUrl,
15
15
  truncateStatusText
16
- } from "../chunk-RFUE5VBK.js";
16
+ } from "../chunk-3ENACZ27.js";
17
17
  import {
18
18
  GET
19
19
  } from "../chunk-4RBEYCOG.js";
@@ -23,7 +23,7 @@ import {
23
23
  getPluginOAuthConfig,
24
24
  getStateAdapter,
25
25
  parseOAuthTokenResponse
26
- } from "../chunk-OZFXD5IG.js";
26
+ } from "../chunk-BKYYVLVN.js";
27
27
  import {
28
28
  logException,
29
29
  logInfo
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  POST
3
- } from "../chunk-TEQ3UIS7.js";
3
+ } from "../chunk-ECEC25CR.js";
4
4
  import "../chunk-PY4AI2GZ.js";
5
5
  export {
6
6
  POST
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"