bible270 1.3.0 → 1.3.2

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: 90443d781de608736a3f9fdb35b68b9a85d24d2b2b4f56c3980f54975d239949
4
- data.tar.gz: cb3dede7983920cf33aaf31b4d6070ec142874063702071512ad60aa387d8899
3
+ metadata.gz: 1045882b2a544c39d4f9c4b6282c4dd67861f1af380d4af7ad1cd226b57dcaee
4
+ data.tar.gz: 03c9162733bfaf96cc08fcd101231174efbf97378cdefe47e55d91d603c0b6bd
5
5
  SHA512:
6
- metadata.gz: '02703879de6569e5f254de78bd32e4b9c911ca4daef9ca3bc4942ad1816baec285582f10bb1b4d9080d97dfd7588d9c343234cf0a5f2596f82fdfe758113f5a6'
7
- data.tar.gz: 8e219a377d05acbe62ccea4bc39cf25a1b902bf98cc42495b82c53dbc9282104c14fb3abc55eed09ea910a84cd0e9b05c5063d8836b2eac3798f504fe914653d
6
+ metadata.gz: 8bc8c454821233d8c899af8c6224b08d5c48b615ac2c6bbf5dc03140cce041c60c7f1208c78a631576875b3eb3507ca82ae61e2c57a19b5c4fe0e6aab3d30c1d
7
+ data.tar.gz: 735cf1ba5f33e2f56bd87cbd2720eeb6b685822b148b7b2a13fd8e7537dcd63cf73e6253e050445be136087bcacc4802dcda36c939f1080994c2a8733a1f4b78
data/CHANGELOG.md CHANGED
@@ -4,18 +4,34 @@ All notable changes to bible270. Format follows [Keep a Changelog](https://keepa
4
4
 
5
5
  ## Unreleased Changes
6
6
 
7
+ ### Fixed
8
+
9
+ - correct Day 27's New Testament reading to include Matthew 26:75
10
+ - silently recover all Turbo interactions from stale sessions, retry once with a fresh CSRF token, and reload rather than submit with a known-stale token if refreshing fails
11
+
12
+ **[Full Changelog](https://github.com/avonderluft/bible270/compare/v1.3.0...main)**
13
+
14
+ ## [1.3.0] - 2026-08-29
15
+
7
16
  ### Added
8
17
 
9
- - let readers choose reflection emails for every new reflection and reply, only replies to their reflections and mentions of them, or none; administrators can manage the same setting, pending migrations are explained instead of silently hiding it, and existing preferences retain their previous behavior
10
- - suggest up to five unambiguous reader handles only while a signed-in writer types `@`, with keyboard and touch selection and no change to server-authoritative mention resolution
11
18
  - add Bible.com as the first-listed and default reader/admin Scripture source for every offered translation, using chapter links and WLC Hebrew or THGNT Greek when `HEB/GRK` is selected; existing reader choices are preserved
12
19
  - add `ALLGRK — LXX OT and Greek NT` immediately after `HEB/GRK`, using Blue Letter Bible's mGNT/LXX routing or Bible.com's GRCBRENT Old Testament and THGNT New Testament
13
20
 
21
+ **[Full Changelog](https://github.com/avonderluft/bible270/compare/v1.2.0...v1.3.0)**
22
+
23
+ ## [1.2.0] - 2026-08-28
24
+
25
+ ### Added
26
+
27
+ - let readers choose reflection emails for every new reflection and reply, only replies to their reflections and mentions of them, or none; administrators can manage the same setting, pending migrations are explained instead of silently hiding it, and existing preferences retain their previous behavior
28
+ - suggest up to five unambiguous reader handles only while a signed-in writer types `@`, with keyboard and touch selection and no change to server-authoritative mention resolution
29
+
14
30
  ### Fixed
15
31
 
16
32
  - refresh stale `Reader` column information after an in-process database migration so newly available reflection email controls do not remain hidden until the web process restarts
17
33
 
18
- **[Full Changelog](https://github.com/avonderluft/bible270/compare/v1.1.7...main)**
34
+ **[Full Changelog](https://github.com/avonderluft/bible270/compare/v1.1.7...v1.2.0)**
19
35
 
20
36
  ## [1.1.7] - 2026-08-27
21
37
 
@@ -575,6 +591,8 @@ This is the initial public release.
575
591
 
576
592
  * Email sign-in requires working Action Mailer delivery in the host application. Set `config.mailer_from`; delivery is inline by default, or set `email_sign_in_deliver_later` when a queue backend is available.
577
593
 
594
+ [1.3.0]: https://github.com/avonderluft/bible270/releases/tag/v1.3.0
595
+ [1.2.0]: https://github.com/avonderluft/bible270/releases/tag/v1.2.0
578
596
  [1.1.7]: https://github.com/avonderluft/bible270/releases/tag/v1.1.7
579
597
  [1.1.6]: https://github.com/avonderluft/bible270/releases/tag/v1.1.6
580
598
  [1.1.5]: https://github.com/avonderluft/bible270/releases/tag/v1.1.5
@@ -116,18 +116,15 @@ module Bible270
116
116
  reason = error ? error.class : 'an unverified request'
117
117
  Rails.logger.info("[bible270] silently refreshing a page after #{reason}")
118
118
 
119
- if stale_turbo_checkoff?
119
+ if request.format.turbo_stream?
120
120
  response.set_header('X-Bible270-Refresh-Session', 'true')
121
+ response.set_header('Cache-Control', 'no-store')
121
122
  head :conflict
122
123
  else
123
124
  redirect_back fallback_location: root_path, allow_other_host: false, status: :see_other
124
125
  end
125
126
  end
126
127
 
127
- def stale_turbo_checkoff?
128
- controller_name == 'checkoffs' && action_name == 'toggle' && request.format.turbo_stream?
129
- end
130
-
131
128
  # Guard participation (checking off / commenting). Viewing is always open.
132
129
  def require_reader!
133
130
  return true if signed_in?
@@ -35,6 +35,7 @@
35
35
  let sessionRefreshedAt = Date.now();
36
36
  let sessionRefresh = null;
37
37
  let hiddenAt = null;
38
+ const submitters = new WeakMap();
38
39
 
39
40
  function updateAuthenticityToken(token) {
40
41
  const meta = document.querySelector("meta[name='csrf-token']");
@@ -97,6 +98,9 @@
97
98
  });
98
99
 
99
100
  document.addEventListener("submit", (event) => {
101
+ const submittedForm = event.target.closest("form");
102
+ if (submittedForm && event.submitter) submitters.set(submittedForm, event.submitter);
103
+
100
104
  const form = event.target.closest("form[data-b270-submit='true']");
101
105
  if (!form) return;
102
106
 
@@ -111,8 +115,7 @@
111
115
  form.requestSubmit(submitter || undefined);
112
116
  }).catch(() => {
113
117
  delete form.dataset.b270AwaitingSession;
114
- sessionRefreshedAt = Date.now();
115
- form.requestSubmit(submitter || undefined);
118
+ window.location.reload();
116
119
  });
117
120
  return;
118
121
  }
@@ -134,17 +137,22 @@
134
137
 
135
138
  function staleSessionResponse(fetchResponse) {
136
139
  if (!fetchResponse) return false;
137
- if (fetchResponse.statusCode === 422) return true;
138
140
 
139
- return fetchResponse.statusCode === 409 &&
140
- fetchResponse.response.headers.get("X-Bible270-Refresh-Session") === "true";
141
+ const response = fetchResponse.response;
142
+ if (fetchResponse.statusCode === 409 &&
143
+ response.headers.get("X-Bible270-Refresh-Session") === "true") return true;
144
+
145
+ // Older deployments can still return Rails' HTML 422 page. Do not confuse
146
+ // an intentional Turbo Stream validation response with an expired session.
147
+ const contentType = response.headers.get("Content-Type") || "";
148
+ return fetchResponse.statusCode === 422 && contentType.includes("text/html");
141
149
  }
142
150
 
143
151
  document.addEventListener("turbo:before-fetch-response", (event) => {
144
152
  const target = event.target;
145
- const form = target.closest && target.closest("form[data-b270-checkoff='true']");
153
+ const form = target.closest && target.closest("form");
146
154
  const response = event.detail.fetchResponse;
147
- if (!form || !staleSessionResponse(response)) return;
155
+ if (!form || form.method.toLowerCase() === "get" || !staleSessionResponse(response)) return;
148
156
 
149
157
  event.preventDefault();
150
158
  if (form.dataset.b270RetriedAfterStaleSession === "true") {
@@ -152,9 +160,12 @@
152
160
  return;
153
161
  }
154
162
 
163
+ const submitter = submitters.get(form);
155
164
  form.dataset.b270RetriedAfterStaleSession = "true";
156
165
  resetForm(form);
157
- refreshSession().then(() => form.requestSubmit()).catch(() => window.location.reload());
166
+ refreshSession()
167
+ .then(() => form.requestSubmit(submitter || undefined))
168
+ .catch(() => window.location.reload());
158
169
  });
159
170
 
160
171
  document.addEventListener("turbo:submit-end", (event) => {
@@ -165,6 +176,7 @@
165
176
  if (form.dataset.b270RetriedAfterStaleSession === "true" &&
166
177
  staleSessionResponse(event.detail.fetchResponse)) return;
167
178
 
179
+ delete form.dataset.b270RetriedAfterStaleSession;
168
180
  if (event.detail.success) {
169
181
  announce(form.dataset.b270Success || "Saved.", "success");
170
182
  } else {
@@ -61,7 +61,7 @@ module Bible270
61
61
  'Zechariah' => [21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21],
62
62
  'Malachi' => [14, 17, 18, 6],
63
63
  'Matthew' => [25, 22, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 45, 39, 51, 46,
64
- 74, 66, 20],
64
+ 75, 66, 20],
65
65
  'Mark' => [45, 28, 35, 40, 43, 56, 36, 37, 50, 52, 33, 44, 37, 72, 47, 20],
66
66
  'Luke' => [80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53],
67
67
  'John' => [51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bible270
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible270
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft