שגיאה בנושאים מקסימליים ביום הראשון, 4 ימים אחרי הנושא הראשון

סיכום מבוסס בינה מלאכותית

The discussion addresses a bug where users with existing topics (created 4 days ago) are incorrectly blocked from creating new topics due to the ‘max topics in first day’ setting. markersocial notes that the setting should only apply to the 24-hour period after a user’s first post, not to all TL0 users. simon confirms the code incorrectly checks for TL0 status instead of the user’s first 24 hours. markersocial suggests renaming the settings and updating error messages for clarity. Ed_S points out a discrepancy in the code logic. martin resolves the issue with a fix that restores the intended behavior, ensuring TL0 users are only treated as ‘new’ during their first 24 hours.

הודעת השגיאה הייתה:

הגעת למספר המרבי של נושאים שמשתמש חדש יכול ליצור ביום הראשון שלו. אנא המתן שעתיים לפני שתקליד שוב.

נראה שזה נשלט על ידי: ‘max topics in first day’ - התאמת הגדרה זו הסירה את השגיאה.

הבעיה היא, שלמשתמש יש 8 נושאים קודמים כשהראשון היה לפני 4 ימים. אז אני חושב שהם לא אמורים להיות מושפעים מהגדרה זו, מכיוון שהיא אמורה להשפיע רק על התקופה של 24 שעות לאחר הפוסט הראשון של המשתמש. חשבון הפוסט הוא משתמש TL0.

תיאור האפשרות הוא:

המספר המרבי של נושאים שמשתמש רשאי ליצור בפרק זמן של 24 שעות לאחר יצירת הפוסט הראשון שלו

כדאי לבדוק אם זה נכון גם עבור ההגדרה ‘max replies in first day’.

Yes, the code seems to be checking to see if a user is TL0 - not checking that it’s the user’s first 24 hours on the site. If that’s the case, possibly the message that is displayed to the user should be changed. The default requirements for achieving TL1 are fairly low though. I’d expect that considering TL0 users to be new users is correct for most cases.

לייק 1

@simon Yeah, I’m experimenting with adjusting the difficulty for users to achieve TL1+.

If the functionality of these settings are kept the same (and assuming it is the same case for max replies in first day), I think it could be good to rename them to be consistent with the other ‘newuser’ settings. As well as update the message to users as you mentioned and the setting descriptions.

E.g.
max topics in first day → newuser max topics per day
max replies in first day → newuser max replies per day

Is this still not as it should be? This code
looks wrong to me, checking if the user’s first post is more than a day old?

 def new_user_posting_on_first_day?
    !staff? && trust_level < TrustLevel[2] &&
      (
        trust_level == TrustLevel[0] || self.first_post_created_at.nil? ||
          self.first_post_created_at >= 24.hours.ago
      )
  end

Okay it was a little tricky to untangle, but I think this will correct the issue:

https://github.com/discourse/discourse/pull/33303

Basically we changed the intent of new_user_posting_on_first_day? years ago so it didn’t match the description and the errors. This restores the old behaviour and doesn’t treat TL0 users as new users at all times for the purposes of this check.

3 לייקים