one icon indicating copy to clipboard operation
one copied to clipboard

OneFlow doesn't work with sinatra 4.0.0

Open xorel opened this issue 1 year ago • 2 comments

Description On Debian12, ruby 3.1 the sinatra gem resolved to 4.0.0 (requiring also rackup gem when started as web server) is not compatible with oneflow.

Creating a json template fails:

oneflow-template create tmpl.json 
unexpected token at ''

An alternative option would be to avoid sinatra 4.0.0

Details

  • Affected Component: oneflow
  • OS: Debian 12
  • Version: 6.99

xorel avatar Feb 21 '24 16:02 xorel

In order to use Sinatra v.4.0.0, it exists a dependency conflict between Sinatra and Thin, since both requires Rack gem but in different versions, as in the following log is showed:

Bundler could not find compatible versions for gem "rack":
  In Gemfile:
    sinatra (~> 4.0) was resolved to 4.0.0, which depends on
      rack (>= 3.0.0, < 4)

    thin was resolved to 1.8.2, which depends on
      rack (>= 1, < 3)

Besides, Sinatra from version 3.1.0 uses Puma as default server, so we consider the best is to update Sinatra to Version 4.0.0 and also begin to use Puma.

Nevertheless, we can reproduce this issue using WEBrick as Web Server and we are going to fix it for this scenario

MiguelERuiz avatar Aug 09 '24 12:08 MiguelERuiz

We could reproduce the problem and basically is on Sinatra v4.0.0 is required to send the content-type for POST request. This was something missing on the oneflow-template cli and it's already fixed and tested in both versions of Sinatra (4.0.0 and 3.2.0) to ensure backwards compatibility.

MiguelERuiz avatar Aug 20 '24 12:08 MiguelERuiz