Giter Site home page Giter Site logo

Comments (5)

billba avatar billba commented on May 16, 2024

I find I'm fairly confused by Update and Delete in general. Based on this old PR for DirectLineJS I thought they were just activities you post like any other, in which case wouldn't they go through the existing Post middleware?

from botbuilder-js.

Stevenic avatar Stevenic commented on May 16, 2024

@billba when you post a new activity to a channel the ID of that activity will be returned to you as part of the response to the post. Normally you can ignore this but there are scenarios where you'll want to save this ID off so that you can later update the activity or delete it. A good example of this is an expense report bot that writes a card to the channel with "approve" and "deny" buttons. When the approve button is clicked the bot wants to overwrite the existing card with a new version without buttons that says "Steve approved this". If deny is clicked the bot may want to go back and actually remove the card all together from the channel.

What @tomlm and I realized the other day is that these updates and deletes aren't going through our middleware pipes currently which means things like logging and translation cant happen against in these cases which feels broken. To address this we need to add two new pipes that middleware can optionally override. This is a critical scenario for MS Teams.

from botbuilder-js.

billba avatar billba commented on May 16, 2024

Right, I understand the feature at a high level, but how is it implemented? At one point we talked about implementing update and delete as activities themselves, that take the relevant activityId as a property.

This sounds like a feature that starts with additions to the ActivityAdapter. Once that API is settled, it can move upstream into middleware/context.

from botbuilder-js.

Stevenic avatar Stevenic commented on May 16, 2024

The API has actually been in the Adapter for 2 years. I just forgot about it given it's rarely used. There are others that are used even less. There's a whole attachment CRUD system on there for uploading images to twilio and slack for instance. We're not trying to model any of that directly.

Update would be tricky to model as an activity given that you need to be able to specify the type of activity you're updating. Delete would be more do able but still has a bit of a bad smell to it.

from botbuilder-js.

Stevenic avatar Stevenic commented on May 16, 2024

This work is done.

from botbuilder-js.

Related Issues (20)

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.