Dry-web-roda : roda flow plugin causing routing wildcard

require 'dry/web/roda/application'

class App < Roda
  plugin :flow # or instead extend  Dry::Web::Roda::Application

  route do |r|
    r.get 'ping' do
      'pong'
    end
  end
end

run App.freeze.app

As soon as plugin :flow is added (to Roda or via Dry::Web:Roda::Application), then this route matches wildcard /ping/*

Is this intentional?

That wasn’t intentional, it just wasn’t up-to-date with the latest roda version, as it overrides the roda if_match request method, it needs to track the roda implementation, and I hadn’t noticed as I haven’t been using the gem. (Although I probably wouldn’t have noticed even if I were, so nice find :slight_smile:)

I’m wondering whether it’s worth tracking the roda version number with releases and locking it down as a dependency, WDYT @timriley @solnic @flash-gordon @GustavoCaso @dymaxion

See:

The problem was that the if_match method now expects a single array argument rather than a splat for the args argument.

Depends how much free time :smile: you have to keep it refreshed if you lock down the version. I’d rather get the benefits of new roda changes rather than locking the version. Would it make sense just to detect any breaking changes instead with some continuous integration tests run on each roda version upgrade?

free time, I wish there were such a thing! :stuck_out_tongue:

It depends, I don’t think we can cover every feature of roda to ensure we don’t break it, my thinking with version tracking was that its easy to just check for any changes to if_match on roda releases and update accordingly, so people might be without the new features for a while until I (or someone else) gets around to updating roda-flow, also if it was using hooks on roda releases, it may as well just be a hook to open a Github issue to check/update and release.

1 Like

@timriley @solnic @flash-gordon @GustavoCaso @dymaxion released 0.4.0 with this fix, also with this year-and-a-half-old PR I missed.

@AMHOL I have been doing some experiments, and when generating a fresh dry-web-roda app with roda-flow 0.4.0 the root route always returns a 404 if a do a downgrade to 0.3.1 the root route start working again.

I notice that version from roda between roda-flow and dry-web-roda differ a lot I will do an experiment witha branch in dry-web-roda https://github.com/dry-rb/dry-web-roda/pull/78

I will have a look at roda-flow plugin if can see what is happening but any hint will be appreciated.

@GustavoCaso I guess that because dry-web-roda is using an old version of roda, the if_match method in use in dry-web-roda still takes a splat argument rather than a single array argument and that is where the problem is caused. FWIW I don’t use roda myself anymore, so I’m happy to merge PRs and stuff there but will probably just do the minimum required to maintain it unless I find a need for it myself in the future.

1 Like

@AMHOL I was just investigating that part so I will try to upgrade roda version in dry-web-roda to use the same version as roda-flow. Don’t worry I will try fixing it form dry-web-roda

just curious… if you aren’t using roda anymore, what are you using in preference?

Not in preference, but I’m using Rails at my current job, not that involved with dry-rb anymore.