Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Core/Resgrid.Config/ServiceBusConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ public static class ServiceBusConfig
public static string RabbitUsername = "";
public static string RabbbitPassword = "";
public static string RabbbitExchange = "";

/// <summary>
/// Ceiling for a single serialized message body, in bytes. Sits under the broker's
/// max_message_size, which production reports as 16777216 (16MiB), leaving room to
/// shed payload before the broker refuses it. A body over max_message_size isn't
/// rejected cleanly, it closes the channel with a PRECONDITION_FAILED and takes the
/// connection's in-flight work with it. Keep this below whatever the brokers are
/// configured with; their config lives outside this repository.
/// </summary>
public static int MaxMessageSizeInBytes = 15 * 1024 * 1024;
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Immutability issue in Core/Resgrid.Config/ServiceBusConfig.cs: MaxMessageSizeInBytes is a compile-time constant but is declared as a mutable static field. Declare MaxMessageSizeInBytes as const, or static readonly if runtime assignment is required, to prevent accidental modification.

Kody rule violation: Use `readonly` or `const` for Immutable Data

public const int MaxMessageSizeInBytes = 15 * 1024 * 1024;
Prompt for LLM

File Core/Resgrid.Config/ServiceBusConfig.cs:

Line 68:

Immutability issue in Core/Resgrid.Config/ServiceBusConfig.cs: MaxMessageSizeInBytes is a compile-time constant but is declared as a mutable static field. Declare MaxMessageSizeInBytes as const, or static readonly if runtime assignment is required, to prevent accidental modification.

Suggested Code:

		public const int MaxMessageSizeInBytes = 15 * 1024 * 1024;

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Immutable configuration data in Core/Resgrid.Config/ServiceBusConfig.cs is declared as mutable with public static int MaxMessageSizeInBytes = 15 * 1024 * 1024;, which permits accidental reassignment. Declare MaxMessageSizeInBytes as const to enforce compile-time immutability and communicate fixed configuration semantics.

Kody rule violation: Use `readonly` or `const` for Immutable Data

public const int MaxMessageSizeInBytes = 15 * 1024 * 1024;
Prompt for LLM

File Core/Resgrid.Config/ServiceBusConfig.cs:

Line 70:

Immutable configuration data in `Core/Resgrid.Config/ServiceBusConfig.cs` is declared as mutable with `public static int MaxMessageSizeInBytes = 15 * 1024 * 1024;`, which permits accidental reassignment. Declare `MaxMessageSizeInBytes` as `const` to enforce compile-time immutability and communicate fixed configuration semantics.

Suggested Code:

		public const int MaxMessageSizeInBytes = 15 * 1024 * 1024;

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

#endregion RabbitMQ Bus Values
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,38 @@
<data name="TestResponseReceived" xml:space="preserve">
<value>تلقّى Resgrid ردك على اختبار الاتصال. شكرًا لك.</value>
</data>
<data name="MessageEmailBody" xml:space="preserve">
<value>مرحبًا {0}،



تُجري {1} اختبار اتصال ({2}) للتأكد من إمكانية الوصول إليك.



هذا اختبار. لا توجد حالة طوارئ ولا يلزم اتخاذ أي إجراء سوى تأكيد استلامك لهذا البريد الإلكتروني.



يرجى النقر على الرابط أدناه لتأكيد استلام هذه الرسالة:

{3}



فريق Resgrid</value>
<data name="MessageEmailPreheader" xml:space="preserve">
<value>اختبار اتصال</value>
</data>
<data name="MessageEmailGreeting" xml:space="preserve">
<value>مرحبًا {0}،</value>
</data>
<data name="MessageEmailIntro" xml:space="preserve">
<value>تُجري {0} اختبار اتصال ({1}) للتأكد من إمكانية الوصول إليك.</value>
</data>
<data name="MessageEmailDisclaimer" xml:space="preserve">
<value>هذا اختبار. لا توجد حالة طوارئ ولا يلزم اتخاذ أي إجراء سوى تأكيد استلامك لهذا البريد الإلكتروني.</value>
</data>
<data name="MessageEmailAction" xml:space="preserve">
<value>يرجى تأكيد استلامك لهذه الرسالة.</value>
</data>
<data name="MessageEmailButton" xml:space="preserve">
<value>تأكيد الاستلام</value>
</data>
<data name="MessageEmailTrouble" xml:space="preserve">
<value>إذا لم يعمل الزر أعلاه، فانسخ الرابط أدناه والصقه في متصفح الويب لديك.</value>
</data>
<data name="MessageEmailSignoff" xml:space="preserve">
<value>شكرًا،</value>
</data>
<data name="MessageEmailTeam" xml:space="preserve">
<value>فريق Resgrid</value>
</data>
<data name="MessageEmailDepartmentLabel" xml:space="preserve">
<value>القسم:</value>
</data>
<data name="MessageEmailTestLabel" xml:space="preserve">
<value>اسم الاختبار:</value>
</data>
<data name="MessageEmailSubject" xml:space="preserve">
<value>اختبار اتصال Resgrid: {0}</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,38 @@
<data name="TestResponseReceived" xml:space="preserve">
<value>Resgrid hat Ihre Antwort auf den Kommunikationstest erhalten. Vielen Dank.</value>
</data>
<data name="MessageEmailBody" xml:space="preserve">
<value>Hallo {0},



{1} führt einen Kommunikationstest ({2}) durch, um zu prüfen, ob Sie erreichbar sind.



Dies ist ein TEST. Es liegt kein Notfall vor und es ist keine Reaktion erforderlich, außer den Empfang dieser E-Mail zu bestätigen.



Bitte klicken Sie auf den folgenden Link, um den Empfang zu bestätigen:

{3}



Ihr Resgrid-Team</value>
<data name="MessageEmailPreheader" xml:space="preserve">
<value>Kommunikationstest</value>
</data>
<data name="MessageEmailGreeting" xml:space="preserve">
<value>Hallo {0},</value>
</data>
<data name="MessageEmailIntro" xml:space="preserve">
<value>{0} führt einen Kommunikationstest ({1}) durch, um zu prüfen, ob Sie erreichbar sind.</value>
</data>
<data name="MessageEmailDisclaimer" xml:space="preserve">
<value>Dies ist ein TEST. Es liegt kein Notfall vor und es ist keine Reaktion erforderlich, außer den Empfang dieser E-Mail zu bestätigen.</value>
</data>
<data name="MessageEmailAction" xml:space="preserve">
<value>Bitte bestätigen Sie den Empfang dieser Nachricht.</value>
</data>
<data name="MessageEmailButton" xml:space="preserve">
<value>Empfang bestätigen</value>
</data>
<data name="MessageEmailTrouble" xml:space="preserve">
<value>Falls die Schaltfläche oben nicht funktioniert, kopieren Sie die folgende URL in Ihren Webbrowser.</value>
</data>
<data name="MessageEmailSignoff" xml:space="preserve">
<value>Danke,</value>
</data>
<data name="MessageEmailTeam" xml:space="preserve">
<value>Ihr Resgrid-Team</value>
</data>
<data name="MessageEmailDepartmentLabel" xml:space="preserve">
<value>Abteilung:</value>
</data>
<data name="MessageEmailTestLabel" xml:space="preserve">
<value>Testname:</value>
</data>
<data name="MessageEmailSubject" xml:space="preserve">
<value>Resgrid-Kommunikationstest: {0}</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,38 @@
<data name="TestResponseReceived" xml:space="preserve">
<value>Το Resgrid έλαβε την απάντησή σας στη δοκιμή επικοινωνίας. Ευχαριστούμε.</value>
</data>
<data name="MessageEmailBody" xml:space="preserve">
<value>Γεια σας {0},



Η υπηρεσία {1} εκτελεί δοκιμή επικοινωνίας ({2}) για να επιβεβαιώσει ότι μπορεί να επικοινωνήσει μαζί σας.



Πρόκειται για ΔΟΚΙΜΗ. Δεν υπάρχει έκτακτη ανάγκη και δεν απαιτείται καμία ενέργεια πέραν της επιβεβαίωσης λήψης αυτού του email.



Κάντε κλικ στον παρακάτω σύνδεσμο για να επιβεβαιώσετε τη λήψη αυτού του μηνύματος:

{3}



Η ομάδα του Resgrid</value>
<data name="MessageEmailPreheader" xml:space="preserve">
<value>Δοκιμή επικοινωνίας</value>
</data>
<data name="MessageEmailGreeting" xml:space="preserve">
<value>Γεια σας {0},</value>
</data>
<data name="MessageEmailIntro" xml:space="preserve">
<value>Η υπηρεσία {0} εκτελεί δοκιμή επικοινωνίας ({1}) για να επιβεβαιώσει ότι μπορεί να επικοινωνήσει μαζί σας.</value>
</data>
<data name="MessageEmailDisclaimer" xml:space="preserve">
<value>Πρόκειται για ΔΟΚΙΜΗ. Δεν υπάρχει έκτακτη ανάγκη και δεν απαιτείται καμία ενέργεια πέραν της επιβεβαίωσης λήψης αυτού του email.</value>
</data>
<data name="MessageEmailAction" xml:space="preserve">
<value>Επιβεβαιώστε ότι λάβατε αυτό το μήνυμα.</value>
</data>
<data name="MessageEmailButton" xml:space="preserve">
<value>Επιβεβαίωση λήψης</value>
</data>
<data name="MessageEmailTrouble" xml:space="preserve">
<value>Αν το παραπάνω κουμπί δεν λειτουργεί, αντιγράψτε και επικολλήστε την παρακάτω διεύθυνση URL στο πρόγραμμα περιήγησής σας.</value>
</data>
<data name="MessageEmailSignoff" xml:space="preserve">
<value>Ευχαριστούμε,</value>
</data>
<data name="MessageEmailTeam" xml:space="preserve">
<value>Η ομάδα του Resgrid</value>
</data>
<data name="MessageEmailDepartmentLabel" xml:space="preserve">
<value>Τμήμα:</value>
</data>
<data name="MessageEmailTestLabel" xml:space="preserve">
<value>Όνομα δοκιμής:</value>
</data>
<data name="MessageEmailSubject" xml:space="preserve">
<value>Δοκιμή επικοινωνίας Resgrid: {0}</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,38 @@
<data name="TestResponseReceived" xml:space="preserve">
<value>Resgrid received your communication test response. Thank you.</value>
</data>
<data name="MessageEmailBody" xml:space="preserve">
<value>Hi {0},



{1} is running a communication test ({2}) to confirm it can reach you.



This is a TEST. There is no emergency and no response is required beyond confirming you got this email.



Please click the link below to confirm you received this message:

{3}



The Resgrid Team</value>
<data name="MessageEmailPreheader" xml:space="preserve">
<value>Communication Test</value>
</data>
<data name="MessageEmailGreeting" xml:space="preserve">
<value>Hi {0},</value>
</data>
<data name="MessageEmailIntro" xml:space="preserve">
<value>{0} is running a communication test ({1}) to confirm it can reach you.</value>
</data>
<data name="MessageEmailDisclaimer" xml:space="preserve">
<value>This is a TEST. There is no emergency and no response is required beyond confirming you got this email.</value>
</data>
<data name="MessageEmailAction" xml:space="preserve">
<value>Please confirm you received this message.</value>
</data>
<data name="MessageEmailButton" xml:space="preserve">
<value>Confirm I Got This</value>
</data>
<data name="MessageEmailTrouble" xml:space="preserve">
<value>If you're having trouble with the button above, copy and paste the URL below into your web browser.</value>
</data>
<data name="MessageEmailSignoff" xml:space="preserve">
<value>Thanks,</value>
</data>
<data name="MessageEmailTeam" xml:space="preserve">
<value>The Resgrid Team</value>
</data>
<data name="MessageEmailDepartmentLabel" xml:space="preserve">
<value>Department:</value>
</data>
<data name="MessageEmailTestLabel" xml:space="preserve">
<value>Test Name:</value>
</data>
<data name="MessageEmailSubject" xml:space="preserve">
<value>Resgrid Communication Test: {0}</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,38 @@
<data name="TestResponseReceived" xml:space="preserve">
<value>Resgrid recibió su respuesta a la prueba de comunicación. Gracias.</value>
</data>
<data name="MessageEmailBody" xml:space="preserve">
<value>Hola {0}:



{1} está realizando una prueba de comunicación ({2}) para confirmar que puede contactarle.



Esto es una PRUEBA. No hay ninguna emergencia y no se requiere ninguna acción salvo confirmar que recibió este correo.



Haga clic en el siguiente enlace para confirmar que recibió este mensaje:

{3}



El equipo de Resgrid</value>
<data name="MessageEmailPreheader" xml:space="preserve">
<value>Prueba de comunicación</value>
</data>
<data name="MessageEmailGreeting" xml:space="preserve">
<value>Hola {0}:</value>
</data>
<data name="MessageEmailIntro" xml:space="preserve">
<value>{0} está realizando una prueba de comunicación ({1}) para confirmar que puede contactarle.</value>
</data>
<data name="MessageEmailDisclaimer" xml:space="preserve">
<value>Esto es una PRUEBA. No hay ninguna emergencia y no se requiere ninguna acción salvo confirmar que recibió este correo.</value>
</data>
<data name="MessageEmailAction" xml:space="preserve">
<value>Confirme que recibió este mensaje.</value>
</data>
<data name="MessageEmailButton" xml:space="preserve">
<value>Confirmar recepción</value>
</data>
<data name="MessageEmailTrouble" xml:space="preserve">
<value>Si tiene problemas con el botón anterior, copie y pegue la siguiente URL en su navegador.</value>
</data>
<data name="MessageEmailSignoff" xml:space="preserve">
<value>Gracias,</value>
</data>
<data name="MessageEmailTeam" xml:space="preserve">
<value>El equipo de Resgrid</value>
</data>
<data name="MessageEmailDepartmentLabel" xml:space="preserve">
<value>Departamento:</value>
</data>
<data name="MessageEmailTestLabel" xml:space="preserve">
<value>Nombre de la prueba:</value>
</data>
<data name="MessageEmailSubject" xml:space="preserve">
<value>Prueba de comunicación de Resgrid: {0}</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,38 @@
<data name="TestResponseReceived" xml:space="preserve">
<value>Resgrid a bien reçu votre réponse au test de communication. Merci.</value>
</data>
<data name="MessageEmailBody" xml:space="preserve">
<value>Bonjour {0},



{1} effectue un test de communication ({2}) afin de vérifier qu'il peut vous joindre.



Ceci est un TEST. Il n'y a aucune urgence et aucune action n'est requise, hormis confirmer la réception de cet e-mail.



Veuillez cliquer sur le lien ci-dessous pour confirmer la réception de ce message :

{3}



L'équipe Resgrid</value>
<data name="MessageEmailPreheader" xml:space="preserve">
<value>Test de communication</value>
</data>
<data name="MessageEmailGreeting" xml:space="preserve">
<value>Bonjour {0},</value>
</data>
<data name="MessageEmailIntro" xml:space="preserve">
<value>{0} effectue un test de communication ({1}) afin de vérifier qu'il peut vous joindre.</value>
</data>
<data name="MessageEmailDisclaimer" xml:space="preserve">
<value>Ceci est un TEST. Il n'y a aucune urgence et aucune action n'est requise, hormis confirmer la réception de cet e-mail.</value>
</data>
<data name="MessageEmailAction" xml:space="preserve">
<value>Veuillez confirmer la réception de ce message.</value>
</data>
<data name="MessageEmailButton" xml:space="preserve">
<value>Confirmer la réception</value>
</data>
<data name="MessageEmailTrouble" xml:space="preserve">
<value>Si le bouton ci-dessus ne fonctionne pas, copiez et collez l'URL ci-dessous dans votre navigateur.</value>
</data>
<data name="MessageEmailSignoff" xml:space="preserve">
<value>Merci,</value>
</data>
<data name="MessageEmailTeam" xml:space="preserve">
<value>L'équipe Resgrid</value>
</data>
<data name="MessageEmailDepartmentLabel" xml:space="preserve">
<value>Département :</value>
</data>
<data name="MessageEmailTestLabel" xml:space="preserve">
<value>Nom du test :</value>
</data>
<data name="MessageEmailSubject" xml:space="preserve">
<value>Test de communication Resgrid : {0}</value>
Expand Down
Loading
Loading