solid_stack_web 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db27129d1f850266817f633ff0109fdd3708c7105fdea6d0bcf3035ec1734769
4
- data.tar.gz: 1549319d21ac55da226b2ce4487a8a8a1340531b13c838643fb2754843620518
3
+ metadata.gz: 751c786163048222347e3076055e71d6f656c07901811fde78d81bbfda418561
4
+ data.tar.gz: 210a225f43b6d419f19ac7a3892ba3c1e7dee6fde2dc03576d692db84cfdd377
5
5
  SHA512:
6
- metadata.gz: '02499cb54b94ad58e62204d18f60780cc88e22c62706248f5fb60a4905f36eb822e8243de0351df15a915f740501bde0b973fa9e6a17754ba2741b64f4b6b695'
7
- data.tar.gz: 627aae0342fa4f93ef0a6e25b89e56764ff6bda2e2c75d7b0315675ee2daacdc2e57ed428698485302b2a6950725bf5d63bb5c5c51a6e566d55f141cbf820c08
6
+ metadata.gz: fc7b5c6ff312501e54178512e0e1ff40f561dd88c70213f95bdffad5626bde97383ffc34298638696d8b12b8fd128a168d699f48c9ced47177500ca951a929f0
7
+ data.tar.gz: fba07be1db68a63f67e514a4388de1e2470023aafa4b21919a225f3598b4652994108a9ff1f4aecf4b88534acf33be6f41f164545ec9b1de8937413f7539e278
@@ -21,6 +21,17 @@ module SolidStackWeb
21
21
  { label: "Text", content: str }
22
22
  end
23
23
 
24
+ # Solid Cable stores payloads (and channel names) in a binary (bytea) column,
25
+ # so ActiveRecord hands the view a string with ASCII-8BIT (BINARY) encoding.
26
+ # Appending such a value — once it holds non-ASCII bytes (e.g. a "→" in a
27
+ # Turbo Stream payload) and the UTF-8 output buffer already contains
28
+ # non-ASCII text — raises Encoding::CompatibilityError. Re-tag the bytes as
29
+ # UTF-8 (lossless; the underlying data is UTF-8 source text) before it
30
+ # reaches the view. dup keeps the ActiveRecord attribute string unmutated.
31
+ def to_utf8_text(value)
32
+ value.to_s.dup.force_encoding("UTF-8").scrub
33
+ end
34
+
24
35
  def format_duration(seconds)
25
36
  return "—" if seconds.nil?
26
37
  return "#{(seconds * 1000).round}ms" if seconds < 1
@@ -61,8 +61,8 @@
61
61
  <tbody>
62
62
  <% @channels.each do |channel| %>
63
63
  <tr>
64
- <td class="sqw-monospace sqw-truncate" title="<%= channel[:channel] %>">
65
- <%= link_to channel[:channel], cable_channel_messages_path(channel[:channel_hash]), class: "sqw-link" %>
64
+ <td class="sqw-monospace sqw-truncate" title="<%= to_utf8_text(channel[:channel]) %>">
65
+ <%= link_to to_utf8_text(channel[:channel]), cable_channel_messages_path(channel[:channel_hash]), class: "sqw-link" %>
66
66
  </td>
67
67
  <td><%= channel[:message_count] %></td>
68
68
  <td class="sqw-muted"><%= local_time(channel[:last_message_at]) %></td>
@@ -1,5 +1,5 @@
1
1
  <div class="sqw-page-header sqw-page-header--split">
2
- <h1 class="sqw-page-title sqw-truncate" title="<%= @channel_name %>"><%= @channel_name %></h1>
2
+ <h1 class="sqw-page-title sqw-truncate" title="<%= to_utf8_text(@channel_name) %>"><%= to_utf8_text(@channel_name) %></h1>
3
3
  <div class="sqw-header-actions">
4
4
  <%= button_to t("solid_stack_web.cable_messages.purge_channel"),
5
5
  cable_channel_purge_path(params[:channel_hash]),
@@ -33,8 +33,8 @@
33
33
  <% @messages.each do |message| %>
34
34
  <tr>
35
35
  <td class="sqw-muted sqw-monospace"><%= message.id %></td>
36
- <td class="sqw-monospace sqw-truncate" title="<%= message.payload %>">
37
- <%= truncate(message.payload.to_s, length: 120) %>
36
+ <td class="sqw-monospace sqw-truncate" title="<%= to_utf8_text(message.payload) %>">
37
+ <%= truncate(to_utf8_text(message.payload), length: 120) %>
38
38
  </td>
39
39
  <td class="sqw-muted">
40
40
  <%= local_time(message.created_at, format: :relative) %>
@@ -1,3 +1,3 @@
1
1
  module SolidStackWeb
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_stack_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuck Smith
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
258
  - !ruby/object:Gem::Version
259
259
  version: '0'
260
260
  requirements: []
261
- rubygems_version: 4.0.10
261
+ rubygems_version: 4.0.20
262
262
  specification_version: 4
263
263
  summary: A unified Rails engine dashboard for Solid Queue, Solid Cache, and Solid
264
264
  Cable.