@sentry/junior 0.71.1 → 0.71.3

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.
package/dist/app.js CHANGED
@@ -23738,44 +23738,57 @@ async function processConversationQueueMessage(message, options) {
23738
23738
  state: options.state
23739
23739
  });
23740
23740
  }
23741
- async function handleConversationQueueMessage(message, options) {
23741
+ async function handleConversationQueueMessage(message, metadata, options) {
23742
23742
  const verification = verifyConversationQueueMessage(message);
23743
23743
  if (verification.status === "rejected") {
23744
- throw new ConversationQueueMessageRejectedError(
23745
- verification.reason,
23746
- "Unauthorized conversation queue message"
23747
- );
23744
+ logConversationQueueMessageRejected(verification.reason, metadata);
23745
+ return;
23748
23746
  }
23749
23747
  if (verification.status === "unavailable") {
23750
23748
  throw new Error(
23751
23749
  `Conversation queue message verification unavailable: ${verification.reason}`
23752
23750
  );
23753
23751
  }
23754
- await runWithTurnRequestDeadline(
23755
- () => processConversationQueueMessage(verification.message, options)
23756
- );
23757
- }
23758
- function handleConversationQueueRetry(error, metadata) {
23759
- if (!isConversationQueueMessageRejectedError(error)) {
23760
- return void 0;
23752
+ try {
23753
+ await runWithTurnRequestDeadline(
23754
+ () => processConversationQueueMessage(verification.message, options)
23755
+ );
23756
+ } catch (error) {
23757
+ if (isConversationQueueMessageRejectedError(error)) {
23758
+ logConversationQueueMessageRejected(error.reason, metadata, {
23759
+ conversationId: error.conversationId
23760
+ });
23761
+ return;
23762
+ }
23763
+ throw error;
23761
23764
  }
23765
+ }
23766
+ function logConversationQueueMessageRejected(reason, metadata, context = {}) {
23762
23767
  logWarn(
23763
23768
  "conversation_queue_message_rejected",
23764
- error.conversationId ? { conversationId: error.conversationId } : {},
23769
+ context.conversationId ? { conversationId: context.conversationId } : {},
23765
23770
  {
23766
23771
  "app.queue.consumer_group": metadata.consumerGroup,
23767
23772
  "app.queue.delivery_count": metadata.deliveryCount,
23768
23773
  "app.queue.message_id": metadata.messageId,
23769
- "app.queue.reject_reason": error.reason,
23774
+ "app.queue.reject_reason": reason,
23770
23775
  "app.queue.topic_name": metadata.topicName
23771
23776
  },
23772
23777
  "Conversation queue message rejected without retry"
23773
23778
  );
23779
+ }
23780
+ function handleConversationQueueRetry(error, metadata) {
23781
+ if (!isConversationQueueMessageRejectedError(error)) {
23782
+ return void 0;
23783
+ }
23784
+ logConversationQueueMessageRejected(error.reason, metadata, {
23785
+ conversationId: error.conversationId
23786
+ });
23774
23787
  return { acknowledge: true };
23775
23788
  }
23776
23789
  function createVercelConversationWorkCallback(options) {
23777
23790
  return handleCallback(
23778
- (message) => handleConversationQueueMessage(message, options),
23791
+ (message, metadata) => handleConversationQueueMessage(message, metadata, options),
23779
23792
  {
23780
23793
  retry: handleConversationQueueRetry,
23781
23794
  visibilityTimeoutSeconds: options.visibilityTimeoutSeconds ?? resolveConversationWorkVisibilityTimeoutSeconds()
@@ -23789,7 +23802,7 @@ function registerVercelConversationWorkDevConsumer(options) {
23789
23802
  return registerDevConsumer({
23790
23803
  client: new QueueClient(),
23791
23804
  consumerGroup: CONVERSATION_WORK_DEV_CONSUMER_GROUP,
23792
- handler: (message) => handleConversationQueueMessage(message, options),
23805
+ handler: (message, metadata) => handleConversationQueueMessage(message, metadata, options),
23793
23806
  retry: handleConversationQueueRetry,
23794
23807
  topic: resolveConversationWorkQueueTopic(options),
23795
23808
  visibilityTimeoutSeconds: options.visibilityTimeoutSeconds ?? resolveConversationWorkVisibilityTimeoutSeconds()
@@ -3,7 +3,7 @@ export interface ConversationQueueMessage {
3
3
  conversationId: string;
4
4
  destination: Destination;
5
5
  }
6
- export type ConversationQueueMessageRejectReason = "destination_mismatch" | "expired" | "malformed" | "signature_mismatch" | "unauthorized";
6
+ export type ConversationQueueMessageRejectReason = "destination_mismatch" | "expired" | "malformed" | "signature_mismatch";
7
7
  export declare class ConversationQueueMessageRejectedError extends Error {
8
8
  conversationId?: string;
9
9
  reason: ConversationQueueMessageRejectReason;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.71.1",
3
+ "version": "0.71.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -65,7 +65,7 @@
65
65
  "node-html-markdown": "^2.0.0",
66
66
  "yaml": "^2.9.0",
67
67
  "zod": "^4.4.3",
68
- "@sentry/junior-plugin-api": "0.71.1"
68
+ "@sentry/junior-plugin-api": "0.71.3"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/node": "^25.9.1",
@@ -78,7 +78,7 @@
78
78
  "typescript": "^6.0.3",
79
79
  "vercel": "^54.4.0",
80
80
  "vitest": "^4.1.7",
81
- "@sentry/junior-scheduler": "0.71.1"
81
+ "@sentry/junior-scheduler": "0.71.3"
82
82
  },
83
83
  "scripts": {
84
84
  "build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",