PostCreator לא שולח הודעות פרטיות

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

In a development environment, NateDhaliwal encountered an issue where private messages (PMs) weren’t being sent to the Admins group despite the scheduled job running and meeting its criteria. pfaffman suggested adding debug output to inspect the PostCreator call, which NateDhaliwal tried but saw no output, prompting a review of conditional logic. merefield recommended disabling validation and clarified the job runs twice daily unless adjusted — NateDhaliwal confirmed it runs every 10 seconds in dev. merefield also noted messy indentation and possible misplaced end statements, illustrated with a screenshot. NateDhaliwal considered switching to flagging as an alternative. Moin raised the critical point that by default, no one may be allowed to message the Admins group — confirmed by a screenshot — and pfaffman advised testing the call in the Rails console or sending to a specific admin user. NateDhaliwal confirmed the issue was resolved after changing group messaging permissions but remains puzzled that the JSON request returned no data.

For some weird reason, PMs are not sent to the Admins group on my dev install.
The job is running, so I don’t see why the PM wouldn’t be sent, even though its sending criteria is met?

אני אוסיף puts לפני הקריאה ל-PostCreator ואקצה את מה שהיא מחזירה למשתנה כדי שתוכל להדפיס אותו לאחר שהיא נקראת.

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

כמה דברים:

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

אוי סליחה, הייתי צריך להוסיף: סביבת הפיתוח שלי גורמת לזה לרוץ כל 10 שניות.

Your "end"s look untidy and the indentation should be tidied up.

You may have one too many/in the wrong place?

אולי הייתי צריך להבהיר - גם כשכל הבדיקות עברו, אף הודעה פרטית לא נשלחה. אולי כדאי לי לנסות לעשות אפשרות סימון במקום?

Is anyone allowed to message your admin group? I think by default nobody is
image

Good one! Does that call work at the rails console? Also, try just sending it to the admin user.

Yes, I can now message the admins group after changing that setting. What puzzles me now, is that the json request doesn’t even seem to return anything :thinking:…