Skip to content

Skip comment template digest on writes#137

Merged
HamptonMakes merged 1 commit into
mainfrom
hampton/comment-cache-digest
Jul 16, 2026
Merged

Skip comment template digest on writes#137
HamptonMakes merged 1 commit into
mainfrom
hampton/comment-cache-digest

Conversation

@HamptonMakes

Copy link
Copy Markdown
Collaborator

Why

Production comment writes intermittently take 400–900 ms because the synchronous broadcast computes a fragment template digest. Rails also misreads the partial's render once prose as a dependency on the nonexistent onces/once template.

What

  • Skip the template digest while retaining record-versioned comment body caching
  • Add an explicit cache namespace for intentional invalidation when Markdown rendering changes
  • Reword the ERB comment so Rails cannot infer a bogus render dependency
  • Add request coverage proving caching remains active without invoking the digestor

Risk Assessment

Low — comment HTML and broadcast behavior are unchanged. Existing cache entries are refreshed under the new namespace, and comment edits continue to invalidate via the record cache key.

References

Generated with Amp

@HamptonMakes
HamptonMakes marked this pull request as ready for review July 14, 2026 18:48
@HamptonMakes
HamptonMakes merged commit 3cbae42 into main Jul 16, 2026
4 checks passed
@HamptonMakes
HamptonMakes deleted the hampton/comment-cache-digest branch July 16, 2026 15:51
HamptonMakes added a commit that referenced this pull request Jul 16, 2026
* origin/main:
  Markdown extensions: footnotes, hover definitions, collapsible sections (#142)
  Fix checkbox toggle targeting via sourcepos-derived line verification (#138)
  Skip comment template digest on writes (#137)

# Conflicts:
#	spec/requests/comments_spec.rb
HamptonMakes added a commit that referenced this pull request Jul 16, 2026
* origin/main:
  Perf: instant comment feedback, cached markdown rendering, quieter presence (#139)
  Markdown extensions: footnotes, hover definitions, collapsible sections (#142)
  Fix checkbox toggle targeting via sourcepos-derived line verification (#138)
  Skip comment template digest on writes (#137)
HamptonMakes added a commit that referenced this pull request Jul 16, 2026
…pace

* origin/main:
  Human editing UI: markdown editor, status dropdown, tag editing (items 1+2) (#141)
  Perf: instant comment feedback, cached markdown rendering, quieter presence (#139)
  Markdown extensions: footnotes, hover definitions, collapsible sections (#142)
  Fix checkbox toggle targeting via sourcepos-derived line verification (#138)
  Skip comment template digest on writes (#137)

# Conflicts:
#	engine/app/assets/stylesheets/coplan/application.css
#	engine/app/controllers/coplan/plans_controller.rb
HamptonMakes added a commit that referenced this pull request Jul 16, 2026
* origin/main:
  Folders + sidebar workspace index (COPLAN items 6+7) (#145)
  Human editing UI: markdown editor, status dropdown, tag editing (items 1+2) (#141)
  Perf: instant comment feedback, cached markdown rendering, quieter presence (#139)
  Markdown extensions: footnotes, hover definitions, collapsible sections (#142)
  Fix checkbox toggle targeting via sourcepos-derived line verification (#138)
  Skip comment template digest on writes (#137)

# Conflicts:
#	db/schema.rb
#	engine/app/controllers/coplan/application_controller.rb
#	engine/app/helpers/coplan/plan_events_helper.rb
#	engine/app/models/coplan/plan.rb
#	engine/app/views/coplan/plans/show.html.erb
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.

1 participant