From cd2d3d5fa332954b8db39293ded58aba1438c050 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Mon, 15 Nov 2021 09:53:10 -0500 Subject: [PATCH] :bug: Fix typos in backend --- backend/scripts/build | 2 +- backend/src/app/http/awsns.clj | 4 ++-- backend/src/app/http/oauth.clj | 2 +- backend/src/app/loggers/audit.clj | 6 +++--- backend/src/app/loggers/loki.clj | 2 +- backend/src/app/loggers/zmq.clj | 2 +- backend/src/app/media.clj | 4 ++-- .../app/migrations/sql/0035-add-storage-tables.sql | 2 +- .../app/migrations/sql/0062-fix-metadata-media.sql | 2 +- .../app/migrations/sql/XXXX-drop-obsolete-tables.sql | 2 +- .../migrations/sql/XXXX-trivial-spelling-fixes.sql | 4 ++++ backend/src/app/msgbus.clj | 4 ++-- backend/src/app/rpc.clj | 2 +- backend/src/app/rpc/mutations/comments.clj | 2 +- backend/src/app/rpc/mutations/files.clj | 2 +- backend/src/app/rpc/mutations/management.clj | 6 +++--- backend/src/app/rpc/mutations/profile.clj | 12 ++++++------ backend/src/app/rpc/mutations/teams.clj | 8 ++++---- backend/src/app/rpc/mutations/verify_token.clj | 4 ++-- backend/src/app/rpc/queries/files.clj | 6 +++--- backend/src/app/rpc/queries/profile.clj | 2 +- backend/src/app/rpc/queries/viewer.clj | 2 +- backend/src/app/srepl/main.clj | 2 +- backend/src/app/storage.clj | 12 ++++++------ backend/src/app/tasks/file_media_gc.clj | 4 ++-- backend/src/app/tasks/objects_gc.clj | 2 +- backend/src/app/tasks/telemetry.clj | 2 +- backend/src/app/util/emails.clj | 2 +- backend/src/app/util/migrations.clj | 2 +- backend/src/app/worker.clj | 2 +- backend/test/app/services_files_test.clj | 4 ++-- backend/test/app/services_management_test.clj | 8 ++++---- backend/test/app/storage_test.clj | 4 ++-- 33 files changed, 65 insertions(+), 61 deletions(-) create mode 100644 backend/src/app/migrations/sql/XXXX-trivial-spelling-fixes.sql diff --git a/backend/scripts/build b/backend/scripts/build index 865fed48b..54c6ea868 100755 --- a/backend/scripts/build +++ b/backend/scripts/build @@ -72,7 +72,7 @@ ;; Copy run script template (-> ($ cp "./scripts/manage.template.sh" "./target/dist/manage.sh") check) -;; Add exec permisions to scripts. +;; Add exec permissions to scripts. (-> ($ chmod +x "./target/dist/run.sh") check) (-> ($ chmod +x "./target/dist/manage.sh") check) diff --git a/backend/src/app/http/awsns.clj b/backend/src/app/http/awsns.clj index 7117c6466..11cfe28a8 100644 --- a/backend/src/app/http/awsns.clj +++ b/backend/src/app/http/awsns.clj @@ -173,14 +173,14 @@ (defn- process-report [cfg {:keys [type profile-id] :as report}] - (l/trace :action "procesing report" :report (pr-str report)) + (l/trace :action "processing report" :report (pr-str report)) (cond ;; In this case we receive a bounce/complaint notification without ;; confirmed identity, we just emit a warning but do nothing about ;; it because this is not a normal case. All notifications should ;; come with profile identity. (nil? profile-id) - (l/warn :msg "a notification without identity recevied from AWS" + (l/warn :msg "a notification without identity received from AWS" :report (pr-str report)) (= "bounce" type) diff --git a/backend/src/app/http/oauth.clj b/backend/src/app/http/oauth.clj index 1e0b67498..81713ec5d 100644 --- a/backend/src/app/http/oauth.clj +++ b/backend/src/app/http/oauth.clj @@ -130,7 +130,7 @@ (when-not (set/subset? provider-roles profile-roles) (ex/raise :type :internal :code :unable-to-auth - :hint "not enought permissions")))) + :hint "not enough permissions")))) (cond-> info (some? (:invitation-token state)) diff --git a/backend/src/app/loggers/audit.clj b/backend/src/app/loggers/audit.clj index e312ebba2..d8c5d33f7 100644 --- a/backend/src/app/loggers/audit.clj +++ b/backend/src/app/loggers/audit.clj @@ -150,7 +150,7 @@ (defmethod ig/init-key ::collector [_ cfg] (when (contains? cf/flags :audit-log) - (l/info :msg "intializing audit log collector") + (l/info :msg "initializing audit log collector") (let [input (a/chan 512 event-xform) buffer (aa/batch input {:max-batch-size 100 :max-batch-age (* 10 1000) ; 10s @@ -159,7 +159,7 @@ (when-let [[_type events] (a/ storage diff --git a/backend/src/app/migrations/sql/0035-add-storage-tables.sql b/backend/src/app/migrations/sql/0035-add-storage-tables.sql index d1ec7f9d4..a5d64894f 100644 --- a/backend/src/app/migrations/sql/0035-add-storage-tables.sql +++ b/backend/src/app/migrations/sql/0035-add-storage-tables.sql @@ -22,7 +22,7 @@ CREATE TABLE storage_data ( CREATE INDEX storage_data__id__idx ON storage_data(id); -- Table used for store inflight upload ids, for later recheck and --- delete possible staled files that exists on the phisical storage +-- delete possible staled files that exists on the physical storage -- but does not exists in the 'storage_object' table. CREATE TABLE storage_pending ( diff --git a/backend/src/app/migrations/sql/0062-fix-metadata-media.sql b/backend/src/app/migrations/sql/0062-fix-metadata-media.sql index 5b9823696..02aa86a2c 100644 --- a/backend/src/app/migrations/sql/0062-fix-metadata-media.sql +++ b/backend/src/app/migrations/sql/0062-fix-metadata-media.sql @@ -1,4 +1,4 @@ --- Fix problem with content-type inconherence +-- Fix problem with content-type incoherence UPDATE storage_object so SET metadata = jsonb_set(metadata, '{~:content-type}', to_jsonb(fmo.mtype)) diff --git a/backend/src/app/migrations/sql/XXXX-drop-obsolete-tables.sql b/backend/src/app/migrations/sql/XXXX-drop-obsolete-tables.sql index 50258305c..0dcd2aaa6 100644 --- a/backend/src/app/migrations/sql/XXXX-drop-obsolete-tables.sql +++ b/backend/src/app/migrations/sql/XXXX-drop-obsolete-tables.sql @@ -1,5 +1,5 @@ --- This is a second migration but it should be applied when manual ---- migration intervention is alteady executed. +--- migration intervention is already executed. ALTER TABLE file_media_object ALTER COLUMN media_id SET NOT NULL; DROP TABLE file_media_thumbnail; diff --git a/backend/src/app/migrations/sql/XXXX-trivial-spelling-fixes.sql b/backend/src/app/migrations/sql/XXXX-trivial-spelling-fixes.sql new file mode 100644 index 000000000..bc7d3d7cd --- /dev/null +++ b/backend/src/app/migrations/sql/XXXX-trivial-spelling-fixes.sql @@ -0,0 +1,4 @@ +alter index color_colection__team_id__idx to color_collection__team_id__idx; +alter index icon_colection__team_id__idx to icon_collection__team_id__idx; +alter index file__modified_at__has_media_trimed__idx to file__modified_at__has_media_trimmed__idx; +alter index media_bject__file_id__idx rename to media_object__file_id__idx; diff --git a/backend/src/app/msgbus.clj b/backend/src/app/msgbus.clj index 146da0c83..f80b8334c 100644 --- a/backend/src/app/msgbus.clj +++ b/backend/src/app/msgbus.clj @@ -181,7 +181,7 @@ (reify RedisPubSubListener (message [it pattern topic message]) (message [it topic message] - ;; There are no back pressure, so we use a slidding + ;; There are no back pressure, so we use a sliding ;; buffer for cases when the pubsub broker sends ;; more messages that we can process. (let [val {:topic topic :message (blob/decode message)}] @@ -243,7 +243,7 @@ (recur)) (a/close! rcv-ch))) - ;; Asyncrhonous message processing loop;x + ;; Asynchronous message processing loop;x (a/go-loop [] (if-let [{:keys [topic message]} (a/ (:num-profiles %) 1) rows) (ex/raise :type :validation :code :owner-teams-with-people diff --git a/backend/src/app/rpc/mutations/teams.clj b/backend/src/app/rpc/mutations/teams.clj index 0f44afb17..8dd4b0fd6 100644 --- a/backend/src/app/rpc/mutations/teams.clj +++ b/backend/src/app/rpc/mutations/teams.clj @@ -114,7 +114,7 @@ (when (some :is-owner perms) (ex/raise :type :validation :code :owner-cant-leave-team - :hint "reasing owner before leave")) + :hint "releasing owner before leave")) (when-not (> (count members) 1) (ex/raise :type :validation @@ -134,7 +134,7 @@ (s/keys :req-un [::profile-id ::id])) ;; TODO: right now just don't allow delete default team, in future it -;; should raise a speific exception for signal that this acction is +;; should raise a specific exception for signal that this action is ;; not allowed. (sv/defmethod ::delete-team @@ -173,8 +173,8 @@ ;; We retrieve all team members instead of query the ;; database for a single member. This is just for - ;; convenience, if this bocomes a bottleneck or problematic, - ;; we will change it to more efficient fetch mechanims. + ;; convenience, if this becomes a bottleneck or problematic, + ;; we will change it to more efficient fetch mechanisms. members (teams/retrieve-team-members conn team-id) member (d/seek #(= member-id (:id %)) members) diff --git a/backend/src/app/rpc/mutations/verify_token.clj b/backend/src/app/rpc/mutations/verify_token.clj index 97458b5ca..106580316 100644 --- a/backend/src/app/rpc/mutations/verify_token.clj +++ b/backend/src/app/rpc/mutations/verify_token.clj @@ -134,7 +134,7 @@ ;; If the session does not matches the invited member, replace ;; the session with a new one matching the invited member. - ;; This techinique should be considered secure because the + ;; This technique should be considered secure because the ;; user clicking the link he already has access to the email ;; account. (with-meta @@ -179,7 +179,7 @@ ::audit/profile-id member-id})) ;; In this case, we wait until frontend app redirect user to - ;; registeration page, the user is correctly registered and the + ;; registration page, the user is correctly registered and the ;; register mutation call us again with the same token to finally ;; create the corresponding team-profile relation from the first ;; condition of this if. diff --git a/backend/src/app/rpc/queries/files.clj b/backend/src/app/rpc/queries/files.clj index 7caff964b..4ca786b2c 100644 --- a/backend/src/app/rpc/queries/files.clj +++ b/backend/src/app/rpc/queries/files.clj @@ -84,8 +84,8 @@ (let [perms (get-permissions conn profile-id file-id) ldata (retrieve-share-link conn file-id share-id)] - ;; NOTE: in a future when share-link becomes more powerfull and - ;; will allow us specify which parts of the app is availabel, we + ;; NOTE: in a future when share-link becomes more powerful and + ;; will allow us specify which parts of the app is available, we ;; will probably need to tweak this function in order to expose ;; this flags to the frontend. (cond @@ -227,7 +227,7 @@ (= frame-id uuid/zero) (not (some? (get-in objects [frame-id :thumbnail])))))) - ;; We need to remove from the attribute :shapes its childrens because + ;; We need to remove from the attribute :shapes its children because ;; they will not be sent in the data remove-frame-children (fn [[id shape]] diff --git a/backend/src/app/rpc/queries/profile.clj b/backend/src/app/rpc/queries/profile.clj index b68c6a5f1..a782f565a 100644 --- a/backend/src/app/rpc/queries/profile.clj +++ b/backend/src/app/rpc/queries/profile.clj @@ -106,6 +106,6 @@ ;; --- Attrs Helpers (defn strip-private-attrs - "Only selects a publicy visible profile attrs." + "Only selects a publicly visible profile attrs." [row] (dissoc row :password :deleted-at)) diff --git a/backend/src/app/rpc/queries/viewer.clj b/backend/src/app/rpc/queries/viewer.clj index 9d35f9e07..b36675c3a 100644 --- a/backend/src/app/rpc/queries/viewer.clj +++ b/backend/src/app/rpc/queries/viewer.clj @@ -65,7 +65,7 @@ (ex/raise :type :not-found :code :object-not-found)) - ;; When we have only profile, we need to check read permissiones + ;; When we have only profile, we need to check read permissions ;; on file. (when (and profile-id (not slink)) (files/check-read-permissions! conn profile-id file-id)) diff --git a/backend/src/app/srepl/main.clj b/backend/src/app/srepl/main.clj index 6e9fc80d6..844d6b3a3 100644 --- a/backend/src/app/srepl/main.clj +++ b/backend/src/app/srepl/main.clj @@ -70,7 +70,7 @@ (defn duplicate-file - "This is a raw version of duplication of file just only for forensic analisys" + "This is a raw version of duplication of file just only for forensic analysis" [system file-id email] (db/with-atomic [conn (:app.db/pool system)] (when-let [profile (some->> (prof/retrieve-profile-data-by-email conn (str/lower email)) diff --git a/backend/src/app/storage.clj b/backend/src/app/storage.clj index a06c228e5..947d69776 100644 --- a/backend/src/app/storage.clj +++ b/backend/src/app/storage.clj @@ -188,7 +188,7 @@ object)) (defn clone-object - "Creates a clone of the provided object using backend basded efficient + "Creates a clone of the provided object using backend based efficient method. Always clones objects to the configured default." [{:keys [pool conn] :as storage} object] (us/assert ::storage storage) @@ -323,18 +323,18 @@ returning *;") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Garbage Collection: Analize touched objects +;; Garbage Collection: Analyze touched objects ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; This task is part of the garbage collection of storage objects and -;; is responsible on analizing the touched objects and mark them for deletion +;; is responsible on analyzing the touched objects and mark them for deletion ;; if corresponds. ;; ;; When file_media_object is deleted, the depending storage_object are ;; marked as touched. This means that some files that depend on a ;; concrete storage_object are no longer exists and maybe this -;; storage_object is no longer necessary and can be ellegible for -;; elimination. This task peridically analizes touched objects and +;; storage_object is no longer necessary and can be eligible for +;; elimination. This task periodically analyzes touched objects and ;; mark them as freeze (means that has other references and the object ;; is still valid) or deleted (no more references to this object so is ;; ready to be deleted). @@ -408,7 +408,7 @@ ;; For this situations we need to write a "log" of inserted files that ;; are checked in some time in future. If physical file exists but the ;; database refence does not exists means that leaked file is found -;; and is inmediatelly deleted. The responsability of this task is +;; and is immediately deleted. The responsibility of this task is ;; check that write log for possible leaked files. (def recheck-min-age (dt/duration {:hours 1})) diff --git a/backend/src/app/tasks/file_media_gc.clj b/backend/src/app/tasks/file_media_gc.clj index 2b8a13384..39d194f68 100644 --- a/backend/src/app/tasks/file_media_gc.clj +++ b/backend/src/app/tasks/file_media_gc.clj @@ -6,7 +6,7 @@ (ns app.tasks.file-media-gc "A maintenance task that is responsible to purge the unused media - objects from files. A file is ellegible to be garbage collected + objects from files. A file is eligible to be garbage collected after some period of inactivity (the default threshold is 72h)." (:require [app.common.logging :as l] @@ -107,7 +107,7 @@ :thumbnail-id (:thumbnail-id mobj)) ;; NOTE: deleting the file-media-object in the database - ;; automatically marks as toched the referenced storage + ;; automatically marks as touched the referenced storage ;; objects. The touch mechanism is needed because many files can ;; point to the same storage objects and we can't just delete ;; them. diff --git a/backend/src/app/tasks/objects_gc.clj b/backend/src/app/tasks/objects_gc.clj index a3d06dcdd..9d2e44146 100644 --- a/backend/src/app/tasks/objects_gc.clj +++ b/backend/src/app/tasks/objects_gc.clj @@ -129,7 +129,7 @@ (doseq [{:keys [id] :as profile} profiles] (l/trace :action "delete object" :table table :id id) - ;; Mark the owned teams as deleted; this enables them to be procesed + ;; Mark the owned teams as deleted; this enables them to be processed ;; in the same transaction in the "team" table step. (db/exec-one! conn [sql:mark-owned-teams-deleted id max-age]) diff --git a/backend/src/app/tasks/telemetry.clj b/backend/src/app/tasks/telemetry.clj index 44a232aeb..62ab1d754 100644 --- a/backend/src/app/tasks/telemetry.clj +++ b/backend/src/app/tasks/telemetry.clj @@ -5,7 +5,7 @@ ;; Copyright (c) UXBOX Labs SL (ns app.tasks.telemetry - "A task that is reponsible to collect anonymous statistical + "A task that is responsible to collect anonymous statistical information about the current instance and send it to the telemetry server." (:require diff --git a/backend/src/app/util/emails.clj b/backend/src/app/util/emails.clj index 948ebe437..c16a9273d 100644 --- a/backend/src/app/util/emails.clj +++ b/backend/src/app/util/emails.clj @@ -207,7 +207,7 @@ :content html}]))})) (s/def ::priority #{:high :low}) -(s/def ::to (s/or :sigle ::us/email +(s/def ::to (s/or :single ::us/email :multi (s/coll-of ::us/email))) (s/def ::from ::us/email) (s/def ::reply-to ::us/email) diff --git a/backend/src/app/util/migrations.clj b/backend/src/app/util/migrations.clj index 7b7fb8a44..7f802730d 100644 --- a/backend/src/app/util/migrations.clj +++ b/backend/src/app/util/migrations.clj @@ -20,7 +20,7 @@ ;; --- Implementation (defn- registered? - "Check if concrete migration is already registred." + "Check if concrete migration is already registered." [pool modname stepname] (let [sql "select * from migrations where module=? and step=?" rows (jdbc/execute! pool [sql modname stepname])] diff --git a/backend/src/app/worker.clj b/backend/src/app/worker.clj index 49370e164..995f5ec77 100644 --- a/backend/src/app/worker.clj +++ b/backend/src/app/worker.clj @@ -470,7 +470,7 @@ :type :summary :quantiles [] :name "tasks_checkout_timing" - :help "Latency measured between scheduld_at and execution time." + :help "Latency measured between scheduled_at and execution time." :wrap (fn [rootf mobj] (let [mdata (meta rootf) origf (::original mdata rootf)] diff --git a/backend/test/app/services_files_test.clj b/backend/test/app/services_files_test.clj index 0fb5acc58..c0dc39e32 100644 --- a/backend/test/app/services_files_test.clj +++ b/backend/test/app/services_files_test.clj @@ -174,12 +174,12 @@ :type :image :metadata {:id (:id fmo1)}}}]})] - ;; run the task inmediatelly + ;; run the task immediately (let [task (:app.tasks.file-media-gc/handler th/*system*) res (task {})] (t/is (= 0 (:processed res)))) - ;; make the file ellegible for GC waiting 300ms (configured + ;; make the file eligible for GC waiting 300ms (configured ;; timeout for testing) (th/sleep 300) diff --git a/backend/test/app/services_management_test.clj b/backend/test/app/services_management_test.clj index 7e75d434a..7d237b5d1 100644 --- a/backend/test/app/services_management_test.clj +++ b/backend/test/app/services_management_test.clj @@ -52,7 +52,7 @@ ;; (th/print-result! out) - ;; Check tha tresult is correct + ;; Check that result is correct (t/is (nil? (:error out))) (let [result (:result out)] @@ -127,7 +127,7 @@ ;; (th/print-result! out) - ;; Check tha tresult is correct + ;; Check that result is correct (t/is (nil? (:error out))) (let [result (:result out)] @@ -183,7 +183,7 @@ :name "project 1 (copy)"} out (th/mutation! data)] - ;; Check tha tresult is correct + ;; Check that result is correct (t/is (nil? (:error out))) (let [result (:result out)] @@ -254,7 +254,7 @@ :name "project 1 (copy)"} out (th/mutation! data)] - ;; Check tha tresult is correct + ;; Check that result is correct (t/is (nil? (:error out))) (let [result (:result out)] diff --git a/backend/test/app/storage_test.clj b/backend/test/app/storage_test.clj index 05e471854..23777215b 100644 --- a/backend/test/app/storage_test.clj +++ b/backend/test/app/storage_test.clj @@ -68,7 +68,7 @@ (t/is (true? (sto/del-object storage object))) ;; retrieving the same object should be not nil because the - ;; deletion is not inmediate + ;; deletion is not immediate (t/is (some? (sto/get-object-data storage object))) (t/is (some? (sto/get-object-url storage object))) (t/is (some? (sto/get-object-path storage object))) @@ -248,7 +248,7 @@ (th/sleep 200) ;; storage_pending table should have the object - ;; registred independently of the aborted transaction. + ;; registered independently of the aborted transaction. (let [rows (db/exec! th/*pool* ["select * from storage_pending"])] (t/is (= 1 (count rows))))