Skip to content

Conversation

@iObject
Copy link
Collaborator

@iObject iObject commented Dec 9, 2025

No description provided.

@iObject iObject added the create-package create a temporary npm package on every commit label Dec 9, 2025
@iObject iObject linked an issue Dec 9, 2025 that may be closed by this pull request
@iObject iObject marked this pull request as ready for review December 9, 2025 17:26
@iObject iObject added create-package create a temporary npm package on every commit and removed create-package create a temporary npm package on every commit labels Dec 9, 2025
@rokucommunity rokucommunity deleted a comment from rokucommunity-bot bot Dec 9, 2025
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 3c2e08f. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251209172634.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on a9e1006. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251209183439.tgz

@iObject iObject marked this pull request as draft December 9, 2025 18:36
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 94815bf. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251215174815.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 7692e40. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251216203205.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on a826f2b. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251216203632.tgz

@iObject iObject marked this pull request as ready for review December 17, 2025 23:56
@iObject iObject added create-package create a temporary npm package on every commit and removed create-package create a temporary npm package on every commit labels Dec 17, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for running promises within Roku Task nodes by introducing an event loop mechanism that allows tasks to observe and handle promise state changes through message ports.

Key Changes

  • Added runEventLoop and initTaskFunctionality functions to enable promise support in tasks
  • Modified promise observation logic to conditionally use message ports in task contexts
  • Added test cases demonstrating promise usage in tasks with various scenarios

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/source/promises.bs Core implementation adding task event loop and conditional observation logic
src/source/promises.spec.bs Reformatted indentation (tabs to spaces) and added three task-based test cases
src/components/TestTask.spec.xml New task component definition for testing promise functionality
src/components/TestTask.spec.bs Task implementation with test methods for promise resolution, network calls, and rejection
package.json & package-lock.json Updated brighterscript dependency from 0.69.10 to 0.69.11
demos/simple-brightscript/* Added demo task component and updated MainScene to demonstrate task usage
bsconfig.tests.json & .vscode/settings.json Minor configuration updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 506 to 519
while true
message = wait(0, hostPort)
if message = invalid then continue while

if promises.isPromiseEvent(message) then
promises.internal.notifyListeners(message)
else
if context = invalid then
callback(message)
else
callback(message, context)
end if
end if
end while
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The infinite loop in runEventLoop has no exit condition, which means tasks using this function cannot cleanly terminate. Consider adding a mechanism to break the loop, such as checking for a specific message type or a boolean flag that can be set to terminate the event loop gracefully.

Copilot uses AI. Check for mistakes.
@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on ec7b3e9. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251218134602.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 6f99082. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251219115730.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on 0b0273f. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251219135928.tgz

@rokucommunity-bot
Copy link
Contributor

Hey there! I just built a new temporary npm package based on e359c47. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/promises/releases/download/v0.0.0-packages/rokucommunity-promises-0.6.7-65-support-observing-promises-in-tasks.20251219144557.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-package create a temporary npm package on every commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support observing promises in tasks

3 participants