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

Remove Access protocol and use Dict.get #1244

Closed

Conversation

dukex
Copy link

@dukex dukex commented Oct 2, 2015

With this commit all tests are green on elixir 1.1.0

@josevalim
Copy link
Member

This should not be required as the previous syntax works fine with Elixir 1.1. The opts[key] syntax is not deprecated.

@josevalim josevalim closed this Oct 2, 2015
@dukex
Copy link
Author

dukex commented Oct 2, 2015

👌 I made this pull request only because I ran the tests and received a error (I can't reproduced now) but it's very strange because now I see this file has many opts[key]

So there is any special thing to not use elixir 1.1.0 and close #832

@dukex
Copy link
Author

dukex commented Oct 2, 2015

I found, running mix test -h and got

** (exit) an exception was raised:
    ** (Phoenix.Socket.InvalidMessageError) missing key "topic"
        (phoenix) lib/phoenix/socket/message.ex:31: Phoenix.Socket.Message.from_map!/1
        (phoenix) lib/phoenix/transports/long_poll.ex:171: Phoenix.Transports.LongPoll.publish/4
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4


  1) test pubsub: shuts down after timeout (Phoenix.Integration.LongPollTest)
     test/phoenix/integration/long_poll_test.exs:227
     ** (FunctionClauseError) no function clause matching in Access.fetch/2
     stacktrace:
       (elixir) lib/access.ex:48: Access.fetch("", "status")
       (elixir) lib/access.ex:72: Access.get/3
       test/phoenix/integration/long_poll_test.exs:238

@pma
Copy link
Contributor

pma commented Oct 2, 2015

Hi,

I've had this problem before and figured it's related to some .beam files
in _build and/or deps previously compiled in pre 1.1.x. So I did:

  1. rm -rf _build deps
  2. mix deps.get
  3. mix compile

And apparently this fixed the problem.

On Fri, Oct 2, 2015 at 1:17 PM, Duke [email protected] wrote:

[image: 👌] I made this pull request only because I ran the tests
and received a error (I can't reproduced now) but it's very strange because
now I see this file has many opts[key]

So there is any special thing to not use elixir 1.1.0 and close #832
#832


Reply to this email directly or view it on GitHub
#1244 (comment)
.

@chrismccord
Copy link
Member

Thanks for taking a look, but this is actually a race condition in our long poller tests that is triggered occasionally. So the symptom was an Access.get error, but the Dict.get would be the same issue. The problem is the request body is blank

@dukex
Copy link
Author

dukex commented Oct 2, 2015

Thanks for explication @chrismccord

@dukex dukex deleted the using-dict-instead-of-access branch October 2, 2015 14:04
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