Skip to content

Pass inbox items during subscribe ruleset callback#1449

Closed
Spencer-Smith wants to merge 5 commits intomainfrom
impr/handleInboxItems
Closed

Pass inbox items during subscribe ruleset callback#1449
Spencer-Smith wants to merge 5 commits intomainfrom
impr/handleInboxItems

Conversation

@Spencer-Smith
Copy link
Collaborator

@Spencer-Smith Spencer-Smith commented Feb 24, 2026

Description

Allows for items with inbox-item schemas to be passed back through during subscribeRuleset callback

Related Issue

Jira

Motivation and Context

Enable message inbox through AJO

Screenshots (if appropriate):

Sandbox demo:
Screenshot 2026-02-25 at 3 22 35 PM
New sandbox page provides buttons to send "messages"

Screenshot 2026-02-25 at 3 22 48 PM

Messages appear as toasts when first received/applied

Screenshot 2026-02-25 at 3 23 00 PM

After toast disappears (unless dismissed), inbox shows new messages

Screenshot 2026-02-25 at 3 23 19 PM

Opening inbox shows all messages received

Checklist:

  • I have signed the Adobe Open Source CLA or I'm an Adobe employee.
  • I have made any necessary test changes and all tests pass.
  • I have run the Sandbox successfully.
  • I have added a Changeset (pnpm changeset) or it is not necessary because this PR is not consumer-facing.

@Spencer-Smith Spencer-Smith self-assigned this Feb 24, 2026
@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: 0c57d9d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

const personalizationPayloads = response.getPayloadsByType(
PERSONALIZATION_DECISIONS_HANDLE,
);
decisionProvider.addPayloads(personalizationPayloads);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need to extract the inbox propositions here. This code is run inside the onResponse lifecycle event inside the RulesEngine component so it only needs to return the matching propositions. The regular personalization process with include the inbox proposition in the response already.

So there should be no changes to this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are not ruleset payloads, though, so they don't get evaluated/extracted in the RulesEngine. That was one approach we considered (and in fact originally implemented), but there was a desire to move away from it.

Copy link
Collaborator Author

@Spencer-Smith Spencer-Smith Mar 5, 2026

Choose a reason for hiding this comment

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

Oh wait I forgot that Serban had mentioned this strategy the other day. In that case, I'm not sure any code changes are necessary to the SDK at all? We can just close this MR, right?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can close it. Sorry for making you work for nothing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I actually still got paid for working on this, so it wasn't for nothing

callback: (result, collectEvent) => {
const { propositions = [] } = result;
const newCards = extractContentCards(propositions);
const configFromPayload = extractInboxConfig(propositions);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So the inbox shouldn't be coming from here. it should come from the response on the sendEvent call.

personalization: {
decisionContext: { "~type": "always" },
},
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

add a ".then(" at the end of the applyResponse call to get the inbox proposition.

@Spencer-Smith
Copy link
Collaborator Author

closing this PR as the functionality is not necessary, will rework the sandbox code into a sample for how to use message inbox

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.

3 participants