Skip to content

Conversation

@LordOfPolls
Copy link
Contributor

@LordOfPolls LordOfPolls commented May 21, 2023

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This PR modifies sending behavior to bypass discord's broken image proxy. Allowing normal bot behaviour to continue

The purpose of the feature flag framework is to allow us to remove the relevant code without breaking changes when the code is no longer required

Usage:

bot = Client(...)
const.CLIENT_FEATURE_FLAGS["FOLLOWUP_INTERACTIONS_FOR_IMAGES"] = True

bot.start(...)

Changes

  • Add new feature flag framework for this sort of issue
  • Modify interaction context behaviour to force a deferral when the bot is sending an embedded image
  • Modify send behaviour to use the working endpoint post_followup

Related Issues

Test Scenarios

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2023

Codecov Report

Patch coverage: 15.78% and project coverage change: -12.87 ⚠️

Comparison is base (2e910ae) 60.26% compared to head (34e16ee) 47.40%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@              Coverage Diff              @@
##           unstable    #1414       +/-   ##
=============================================
- Coverage     60.26%   47.40%   -12.87%     
=============================================
  Files           139      139               
  Lines         14638    14656       +18     
=============================================
- Hits           8821     6947     -1874     
- Misses         5817     7709     +1892     
Impacted Files Coverage Δ
interactions/client/client.py 30.51% <0.00%> (-15.20%) ⬇️
interactions/models/internal/context.py 38.37% <10.00%> (-0.55%) ⬇️
interactions/client/const.py 84.00% <33.33%> (-5.37%) ⬇️

... and 63 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@AstreaTSS AstreaTSS left a comment

Choose a reason for hiding this comment

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

I'm going to approve this as an emergency measure since it seems solid, though the UX could really use improving in the future... being just a dict is very eh.

@LordOfPolls
Copy link
Contributor Author

I appreciate that, I was doing this quickly. The ux was the bare minimum to solve this issue

@LordOfPolls LordOfPolls merged commit dc4c623 into unstable May 21, 2023
@LordOfPolls LordOfPolls deleted the image_proxy branch May 21, 2023 18:14
@LordOfPolls LordOfPolls mentioned this pull request May 21, 2023
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.

5 participants