הערכה ל-bypass_bump בעריכות REST API

Continuing the discussion from How to edit post with API without bumping topic?:

I just wanted to add a big thank you to the Discourse team for including the bypass_bump parameter! It’s a small but powerful tool — it allows scripts and plugins to update content behind the scenes without unintentionally surfacing old topics in the latest view.

In our case, we use it for ICS sync scripts, and it ensures only meaningful changes actually bump topics. A thoughtful addition that keeps community forums clean and reader experience undisturbed — thanks again!

2 לייקים

זה לא פוסט שבחים מטעה, כמו הפוסט הקודם שלי🙈, כי

  • Discourse תומך בדגל bypass_bump בעת תיקון פוסט; הוא מונע משינוי תאריך ה-bump של הנושא גם אם אתה עורך את הפוסט האחרון (או הראשון והיחיד). זה מופיע במפורש באפשרויות PostRevisor (“- bypass_bump: אל תבצע bump לנושא, גם אם זה הפוסט האחרון”).
  • נושא השבחים הזה קיים ומציין בדיוק את מקרה השימוש הזה.
  • היסטורית אנשים השתמשו בפתרון העקיף /t/{id}/reset-bump-date מכיוון שאפשרות זו לא הייתה ידועה/מתועדת היטב בתיעוד ה-API, אך היא עדיין זמינה במידת הצורך.

הערה מעשית: כאשר אתה מבצע PUT /posts/{post_id}.json עם ה-raw החדש וכולל bypass_bump=true, העריכה לא תציף את הנושא ב-/latest. (התיעוד הרשמי לא מפרט את הפרמטר הזה, אך הוא מחובר בצד השרת דרך PostRevisor.)

אני עדיין לא בטוח ב-100% לגבי הסטטוס הרשמי של bypass_bump בתיעוד ה-API — הוא לא מופיע בשום מקום ברור.

אבל כשאני מסתכל על הלוגים מ-Ethsim12’s Python sync script, הם מאלפים. הסקריפט מנסה לקרוא ל-API עם bypass_bump=true. אם הפרמטר הזה היה מתעלם או לא תקף, הדבר היחיד שימנע העלאות מיותרות הוא ה-fallback שהם הוסיפו: קריאה ידנית ל-

/t/{topic_id}/reset-bump-date

כך שפלט הלוג עצמו הופך לעדות חזקה. אם הלוג מראה נושאים שמתעדכנים מבלי להופיע ב-/latest (וללא צורך ב-reset fallback), זו הוכחה טובה ש-bypass_bump פעיל ועובד. אם הלוג תמיד חוזר ל-reset-bump-date, אז אולי הוא לא.

במילים אחרות: הלוגים מהסקריפט הזה תורמים רבות לאישור אם bypass_bump קיים ומכובד בפועל על ידי השרת.

You might be interested in this pull request

2 לייקים

Thanks for sharing this PR, moin — really helpful context.

For my side project (ics_to_discourse.py importer), I actually just committed a change to stop calendar-driven updates from “noisily” bumping topics:

That commit adds some logic to decide whether an edit is “meaningful” (time/location change etc.), and uses bypass_bump plus a reset-bump-date fallback so that routine ICS syncs don’t surface topics unnecessarily.

So this PR lines up perfectly with what I was aiming for — nice to see core moving in the same direction. Once the “do not bump on edit” behaviour is merged, I’ll simplify and drop the extra fallback, but for now the commit keeps things quiet on current Discourse installs.

I just noticed this in Praise and have moved it to Dev because it is quite technical. Do appreciate the praise, of course! :hugs:

לייק 1

Hmm, i’ve re-read this topic and realised I didn’t include another relevant PR, when i wasn’t active at University and had the time to code