Giter Site home page Giter Site logo

Comments (5)

rveachkc avatar rveachkc commented on August 20, 2024

To fix the root cause, Microsoft would need respond with a code indicating the failure. Because of this, i'm going to go ahead and close the issue.

If you can uncover the exact max message length and care to submit a pull request limiting this in code, I'd be happy to review.

from pymsteams.

stmoody avatar stmoody commented on August 20, 2024

I did use a script to verify the size constraints, and I'll detail it below if it's interesting, but I talked with the Teams team and believe I found a better way.

It seems the reason for the 200 status in cases where the message doesn't send is due to 3rd party connectors, incorrectly, handling errors by deleting the configuration.

tl;dr
The team let me know that the content of the response will be '1' when the message is sent successfully. So I propose updating the check before returning in send from if r.status_code == requests.codes.ok: to if r.status_code == requests.codes.ok and r.text == '1':
end tl;dr

teams_uri = <<webhook>>
import pymsteams

# x = 20811 # stops sending at 20,812
x = 20827 # stops sending w\o title at 20,828
crd = pymsteams.cardsection()
crd.text('x' * x)
msg = pymsteams.connectorcard(teams_uri)
# msg.title(x)
msg.summary('0') # adding characters stops it
msg.addSection(crd)
msg.send()

It's seemingly the combined data size sent that effects it
Without a summary, I get an exception so I'm using a single char for that (more characters would then mean removing others from the cardsection text or title, but it's not 1-for-1 i.e. a summary of '00' won't work if a "bare text message" is sent w\ 20826 characters
With a title that was the count of characters sent, the limit is 20,811 chars
W\o a title the limit bumps up to 20,827

from pymsteams.

rveachkc avatar rveachkc commented on August 20, 2024

Fair enough. I've re-opened it, and can look at this when I get a chance. Honestly, it might be a bit, so pull requests are welcome.

from pymsteams.

stmoody avatar stmoody commented on August 20, 2024

I've created the change locally and added a test. Do I need certain permissions to create a PR\branch? I'm getting a 403 error. Sorry, first time I'm contributing to someone else's GitHub project

from pymsteams.

rveachkc avatar rveachkc commented on August 20, 2024

This is now merged and released under v0.1.14. Thanks!

from pymsteams.

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.