Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phoenix.Presence.get_by_key/2 typespec, return values, and documentation are inconsistent #5759

Open
jaminthorns opened this issue Mar 22, 2024 · 2 comments

Comments

@jaminthorns
Copy link

Environment

  • Elixir version (elixir -v): 1.16.1
  • Phoenix version (mix deps): 1.7.11
  • Operating system: macOS 14.4 (23E214)

Actual behavior

Issue #4514 was never properly addressed. The commit 3c7f494 says that it addressed the issue, but it only updated the typespec of get_by_key/2 to something that is still inconsistent with the implementation and the example.

Expected behavior

I'll defer to the referenced issue for full explanation and possible solutions, since the author did a great job of breaking down the issue, and I agree with their proposed solutions.

@chrismccord
Copy link
Member

If you think the docs are unclear, please send a PR, but this looks correct to me. The value returned matches the shape of presence() (note singular presence), and the function returns a list of those for that given id. Thanks!

@chrismccord
Copy link
Member

Sorry, you're right the example just wrong :)

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

No branches or pull requests

2 participants