Giter Site home page Giter Site logo

deno-announcement-bot's People

Contributors

cchensh avatar filmaj avatar hello-ashleyintech avatar misscoded avatar srajiang avatar vegeris avatar williambergamin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deno-announcement-bot's Issues

Draft record in Datastore being overwritten instead of updated

Currently, when you run the app:

  • The draft announcement is generated successfully.
  • Errors out when you click the 'Send announcement' button.

Slackbot error message:

:siren: There was an error executing function Create a draft announcement as part of workflow Create an announcement. This workflow belongs to app announcement-bot-app (local). Error details:
Message: parameter_validation_failed Team: Natasha Test 1 Trace ID for developers: Tr0548G4QGCR

CLI error message:

> natasha.thomas of Natasha Test 1
Connected, awaiting events
2023-04-19 11:17:36 [info] [Wf053VPD5G91] (Trace=Tr0548G4QGCR) Execution started for workflow 'Create an announcement'
2023-04-19 11:17:36 [info] [Wf053VPD5G91] (Trace=Tr0548G4QGCR) Executing workflow step 1 of 4
2023-04-19 11:17:36 [info] [Fn010N] (Trace=Tr0548G4QGCR) Function execution started for Slack function 'Open a form'
2023-04-19 11:17:57 [info] [Fn010N] (Trace=Tr0548G4QGCR) Function execution completed for function 'Open a form'
2023-04-19 11:17:58 [info] [Wf053VPD5G91] (Trace=Tr0548G4QGCR) Execution completed for workflow step 'Open a form'
2023-04-19 11:17:59 [info] [Wf053VPD5G91] (Trace=Tr0548G4QGCR) Executing workflow step 2 of 4
2023-04-19 11:17:59 [info] [Fn054KHXN0V6] (Trace=Tr0548G4QGCR) Function execution started for app function 'Create a draft announcement'
Error completing function {
ok: false,
error: "parameter_validation_failed",
error_messages: [ "Missing value for parameter `message`" ]
}
2023-04-19 11:18:17 [error] [Fn054KHXN0V6] (Trace=Tr0548G4QGCR) Function execution failed for function 'Create a draft announcement'
        parameter_validation_failed
2023-04-19 11:18:18 [error] [Wf053VPD5G91] (Trace=Tr0548G4QGCR) Execution failed for workflow step 'Create a draft announcement'
2023-04-19 11:18:18 [error] [Fn053YBR9G76] (Trace=Tr053VT41DAN) Function execution failed for function 'Create an announcement'
        parameter_validation_failed
2023-04-19 11:18:18 [error] [Wf053VPD5G91] (Trace=Tr0548G4QGCR) Execution failed for workflow 'Create an announcement'
        parameter_validation_failed

In the 'Create a draft announcement' function, the file 'handler.ts' creates a new datastore record with the draft.

It then updates the draft record with the successful sent drafts timestamp. This is done using the 'apps.datastore.put' method, but the behaviour of 'apps.datastore.put' was changed on April 6, 2023 to fully replace an item if it exists. So the record that was created previously with the id, created_by, message, channels, channel, icon, username and status fields is replaced by a record the same id and a message_ts field alone. This explains the missing message parameter error.

To partially update an item, the 'apps.datastore.update' method must be used . This is mentioned here: https://api.slack.com/automation/datastores#put

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.