Skip to content

fix: View.from_dict() always returns None#3181

Merged
Paillat-dev merged 7 commits intoPycord-Development:masterfrom
orarange:fix/view-from-dict-return
Mar 28, 2026
Merged

fix: View.from_dict() always returns None#3181
Paillat-dev merged 7 commits intoPycord-Development:masterfrom
orarange:fix/view-from-dict-return

Conversation

@orarange
Copy link
Copy Markdown
Contributor

@orarange orarange commented Mar 25, 2026

Summary

View.from_dict() was missing a return view statement, causing it to always return None.

This was likely dropped during the refactor in #2904. View.from_message() and DesignerView.from_dict() have the correct return statement.

Generative AI (Codex) was used for bug discovery and code review only.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting, examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@orarange orarange requested review from a team, NeloBlivion, Copilot and plun1331 March 25, 2026 03:05
@orarange orarange requested a review from a team as a code owner March 25, 2026 03:05
@orarange orarange requested review from Paillat-dev and removed request for a team March 25, 2026 03:05
@github-project-automation github-project-automation bot moved this to Todo in Pycord Mar 25, 2026
@pycord-app
Copy link
Copy Markdown

pycord-app bot commented Mar 25, 2026

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3181/head:pr-3181
git checkout pr-3181

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3181/head

Copy link
Copy Markdown
Contributor

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

Fixes a regression in discord.ui.View.from_dict() where the method constructed a View but never returned it, causing callers to receive None.

Changes:

  • Add the missing return view statement to View.from_dict().

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

Copy link
Copy Markdown
Member

@Icebluewolf Icebluewolf left a comment

Choose a reason for hiding this comment

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

Good catch. However, you will need a change log as this fixes a bug in a released version.

@orarange orarange requested a review from a team as a code owner March 25, 2026 03:30
@orarange orarange requested review from a user and Soheab March 25, 2026 03:30
Icebluewolf
Icebluewolf previously approved these changes Mar 25, 2026
@plun1331
Copy link
Copy Markdown
Member

Merge conflicts

@orarange orarange force-pushed the fix/view-from-dict-return branch from d2d6a61 to 15da4fd Compare March 25, 2026 03:50
@Paillat-dev Paillat-dev changed the title fix: View.from_dict() always returns None fix: View.from_dict() always returns None Mar 25, 2026
@Paillat-dev Paillat-dev requested a review from JustaSqu1d March 25, 2026 11:21
@Paillat-dev Paillat-dev added this to the v2.8.0 milestone Mar 25, 2026
@Lulalaby Lulalaby requested a review from a team March 25, 2026 11:38
Copy link
Copy Markdown
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

lgtm; should be fine ?; please someone check if the changelog is alright

Dorukyum
Dorukyum previously approved these changes Mar 28, 2026
Signed-off-by: Paillat <jeremiecotti@ik.me>
@Paillat-dev Paillat-dev enabled auto-merge (squash) March 28, 2026 15:40
@Paillat-dev Paillat-dev disabled auto-merge March 28, 2026 15:40
@Paillat-dev Paillat-dev enabled auto-merge (squash) March 28, 2026 15:40
@Paillat-dev Paillat-dev disabled auto-merge March 28, 2026 15:45
@Paillat-dev Paillat-dev merged commit 07b6ee0 into Pycord-Development:master Mar 28, 2026
27 of 28 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Pycord Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants