Skip to content

index: send Tasker items as a broadcast so reminder date/time survives (#392) - #395

Open
loreboldo wants to merge 2 commits into
coredevices:masterfrom
loreboldo:tasker-intent-received
Open

loreboldo wants to merge 2 commits into
coredevices:masterfrom
loreboldo:tasker-intent-received

Conversation

@loreboldo

Copy link
Copy Markdown

Fixes #392.

Problem

Tasker's Received Share event — the mechanism the in-app setup dialog tells users to use — exposes only %rs_text / %rs_subject and drops arbitrary intent extras. So the deadline, notify_before_seconds and list extras TaskerReminderIntegration attaches never reached anyone: a reminder like "call about my reservation at 2pm" arrived in Tasker as bare text with the time stripped, even though the app recognised and displayed it.

No Tasker event reads custom extras off an ACTION_SEND activity intent, so this can't be fixed with a docs change alone.

Change

  • TaskerEndpoint.send keeps the ACTION_SEND activity intent byte-for-byte unchanged (no regression for existing Received Share / AutoShare profiles) and additionally fires an explicit coredevices.coreapp.INDEX_ITEM broadcast carrying every field as an extra.
  • A Tasker Intent Received profile on that action turns each extra into a variable: %text, %message_type, %timestamp, and for reminders %deadline (ISO-8601 UTC), %notify_before_seconds, %list.
  • An explicit broadcast is also exempt from the background-activity-launch limits that already made the activity path unreliable behind a locked screen (noted in the old KDoc).
  • taskerReminderExtras() extracted to commonMain with unit tests.
  • Setup dialog now documents both profiles (A: Received Share, B: Intent Received) and warns that enabling both processes each item twice.

Applies to notes and reminders (notes just carry %text / %message_type / %timestamp).

Tradeoff

Existing Received Share reminder users keep getting bare %rs_text — they need to switch to an Intent Received profile to get %deadline. Chosen over mangling %rs_text (which would change the payload for every current profile) or a forced migration.

Testing

  • TaskerReminderExtrasTest (commonTest): no extras / deadline / deadline+lead / lead-without-deadline dropped / list independent.
  • TaskerEndpoint intent building not unit-tested (would need Robolectric); verified by reading. Manual check: Tasker Intent Received profile on coredevices.coreapp.INDEX_ITEM.
  • <queries> already lists the Tasker package, so the broadcast needs no manifest/permission change.

I don't have a local JDK/Android SDK to run the suite — relying on CI's testAndroidHostTest.

Tasker's "Received Share" event exposes only %rs_text / %rs_subject and
drops custom intent extras, so the deadline / notify_before_seconds / list
extras never reached users — a reminder arrived as bare text with the
time stripped (coredevices#392).

Keep the ACTION_SEND activity intent unchanged and additionally fire a
coredevices.coreapp.INDEX_ITEM broadcast carrying every field as an
extra. A Tasker "Intent Received" profile turns each into a variable
(%text, %message_type, %deadline, ...). An explicit broadcast is also
exempt from the background-activity-launch limits that make the activity
path unreliable behind a locked screen.

Extract taskerReminderExtras() to commonMain with unit tests. Update the
setup dialog to document both profiles and warn against enabling both.
@nirajsanghvi

nirajsanghvi commented Sep 1, 2026

Copy link
Copy Markdown

@loreboldo thanks for taking a stab at this!

I think I'd still want one more extra to come through the new coredevices.coreapp.INDEX_ITEM broadcast that you have added here, and that would be something like raw_text which includes the unaltered original text. The reason for that is that in my specific use case, I want to pass that string along to Todoist's Quick Add API, which will take that string and handle parsing everything, including the deadline, reminders, priority, etc (basically anything it supports extracting from the string that is passed in that is relevant to a Todoist task).

As this change stands currently, in Tasker I would have to take the extras from the broadcast and reassemble them into a single string in order to pass that to the aforementioned Todoist API endpoint, and possibly modify the formatting to provide it to Todoist in a form that feels more like natural language which it is expecting. There's also a chance Todoist would recognize some time or date formatting that the Pebble app doesn't, and vice versa.

In the most ideal case, I'd rather just not have Pebble process any spoken date/time at all because it's not providing any utility in the use case I'm trying to solve. I don't think this is really specific to using Todoist either, there are likely several other use cases when the text is being routed to Tasker, where having the original spoken string fully intact would make more sense than having the Pebble app process it and split out the deadline portion. But receiving the raw text as an additional extra would suffice, I'd just ignore text and deadline.

If it makes sense, I can add these comments to #392 for more context.

Edit: I did add a comment to #392 to provide the additional context.

Per PR feedback on coredevices#392: the broadcast splits the utterance into %text +
%deadline, but some recipes (e.g. Todoist Quick Add) would rather parse
the original spoken phrasing themselves. Carry it verbatim as raw_text.

The transcript is pulled from SessionContext.userMessageText (already
used by the note/calendar/list tools) and threaded through a new
ItemSource.rawText field, so no ReminderIntegration interface change and
external providers other than Tasker are untouched. Covers both the
create_reminder and list-item-with-reminder paths.
@CLAassistant

CLAassistant commented Sep 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@loreboldo

loreboldo commented Sep 3, 2026

Copy link
Copy Markdown
Author

Sorry, had this reply sitting in a draft and forgot to actually hit comment 😅

Added raw_text in 5489be6 - the unaltered transcript now rides the coredevices.coreapp.INDEX_ITEM broadcast as %raw_text, next to the split-out %text / %deadline / %notify_before_seconds. So your Todoist Quick Add recipe can just read %raw_text and ignore the rest.

Heads up that %raw_text is the whole spoken utterance, so it keeps any "remind me to..." lead-in rather than a cleaned-up title (strip it in Tasker, or let Todoist handle it).

On skipping the date/time processing entirely when an external provider is selected: I think that's a separate, bigger change, and it lines up with the spirit of #313 like you said. This keeps the split fields for people who rely on them and adds the raw string for people who'd rather parse it themselves, so hopefully both cases are covered.

Let me know if %raw_text does the job for your Todoist flow!

@nirajsanghvi

Copy link
Copy Markdown

Let me know if %raw_text does the job for your Todoist flow!

That looks good, thanks for incorporating the feedback!

And yeah, skipping the date/time processing entirely did feel like a different change, and I think not necessarily a particularly useful one either, since the latency of that detection/parsing should be pretty minimal anyways, unlike what was going on in the webhook issue. Getting the unaltered utterance as raw_text should be sufficient for most use cases, and definitely covers what I was looking for.

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.

Date and time are stripped when using Tasker for Index reminders

3 participants