Skip to content

fix(typing): explicit handler signatures in PubSubClient - #6564

Merged
FeodorFitsner merged 3 commits into
flet-dev:flet-0.86from
Iaw4tch:fix-pubsub-callable-annotation
Jun 18, 2026
Merged

fix(typing): explicit handler signatures in PubSubClient#6564
FeodorFitsner merged 3 commits into
flet-dev:flet-0.86from
Iaw4tch:fix-pubsub-callable-annotation

Conversation

@Iaw4tch

@Iaw4tch Iaw4tch commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

By default Pylance handles Callable as (...) -> Unknown. This is a minor fix for avoiding a reportUnknownMemberType error

Test code

I wrote such string:

self.page.pubsub.subscribe_topic("emphasis_hue", self._subscription_wrapper)

end ended up with Pylance error:

Type of "subscribe_topic" is partially unknown
Type of "subscribe_topic" is "(topic: str, handler: (...) -> Unknown) -> None" Pylance[reportUnknownMemberType]

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • I have performed a self-review of my own code.
  • My code follows the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • New and existing tests pass locally with my changes.
  • I have made corresponding documentation changes, if applicable.
  • I have added changelog entries for user-facing changes, if applicable.
  • I have updated release guide pages and website/sidebars.yml for breaking changes, removals, and deprecations, if applicable.

Summary by Sourcery

Bug Fixes:

  • Specify concrete Callable signatures for pubsub subscription handlers to resolve Pylance reportUnknownMemberType diagnostics.

By default Pylance handles Callable as (...) -> Unknown. This is a minor fix for avoiding a reportUnknownMemberType error
@CLAassistant

CLAassistant commented Jun 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@ndonkoHenri ndonkoHenri changed the title Update pubsub_client.py fix(typing): explicit handler signatures in PubSubClient Jun 11, 2026
@ndonkoHenri

ndonkoHenri commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution. Can you please update the changelog too? I think 0.85.4 will be the next release, so you could create that section, and add your entry under bug fixes. (example)

@Iaw4tch

Iaw4tch commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for your contribution. Can you please update the changelog too? I think 0.85.4 will be the next release, so you could create that section, and add your entry under bug fixes. (example)

Like this?

@ndonkoHenri
ndonkoHenri changed the base branch from main to flet-0.86 June 12, 2026 17:40
@FeodorFitsner
FeodorFitsner merged commit 2154a2a into flet-dev:flet-0.86 Jun 18, 2026
53 of 84 checks passed
FeodorFitsner added a commit that referenced this pull request Jun 18, 2026
Pulls 6 commits from the flet-0.86 release branch:

* feat(FilePicker): compression_quality + cancel_upload_on_window_blur
  on pick_files() (#6573)
* fix(android): pickFirsts libc++_shared.so (#6571)
* chore: docs + code improvements across packages/flet Dart controls
  (#6589)
* fix(typing): explicit handler signatures in PubSubClient (#6564)
* feat(cli): flet clean command + deprecate --clear-cache (#6590)
* fix(flet-secure-storage): bump flutter_secure_storage 10.0.0 ->
  10.3.1 (#6586)

Conflicts and resolutions:

* sdk/python/templates/build/{{cookiecutter.out_dir}}/android/app/build.gradle.kts
  flet-0.86's #6571 reinstates useLegacyPackaging + keepDebugSymbols +
  pickFirsts inside packaging.jniLibs. dart-bridge intentionally dropped
  useLegacyPackaging / keepDebugSymbols because serious_python's new
  native-mmap loader makes them redundant (CHANGELOG 0.86.0 Improvements).
  The libc++_shared.so collision is a different problem (multi-plugin
  jniLibs duplication, not Python extraction), so keep just the pickFirsts
  block. Restructured the packaging block I added in the previous commit
  so pickFirsts is unconditional and excludes stays gated on
  android_excluded_abis.

* CHANGELOG.md
  Merged the new-features and bug-fixes sections preserving entries from
  both branches: dart-bridge's DataChannel + in-process dart_bridge +
  multi-version Python (with the corrected 314.0.0 GA / sp >= 3.0.0
  blurb that supersedes flet-0.86's 314.0.0a2 / sp >= 2.0.0 stub),
  plus flet-0.86's flet clean, compression_quality, libc++_shared fix,
  PubSubClient typing, and FilePicker pick_files entry. Documentation
  subsection from flet-0.86 added.

* sdk/python/packages/flet-secure-storage/.../pubspec.yaml
  Took flet-0.86's pinned `flutter_secure_storage: 10.3.1` over
  dart-bridge's `^10.0.0` caret range.

* website/docs/updates/breaking-changes/index.md
  Kept dart-bridge's #### Breaking changes subsection and added
  flet-0.86's #### Deprecations subsection beneath it.

* tests/test_python_versions.py (post-merge follow-up, not a conflict)
  Updated the local fixture manifest to carry android_abis on every
  row. Required because the manifest-driven PythonRelease parser no
  longer falls back to an inferred ABI list — the fixtures must reflect
  the same schema as python-build's 20260618+ releases.

Verification: ruff clean on touched files; 62 flet-cli unit tests pass;
imports succeed for build_base, build, clean, python_versions, android.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Iaw4tch
Iaw4tch deleted the fix-pubsub-callable-annotation branch June 20, 2026 18:45
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.

4 participants