damus-io / damus

iOS nostr client
GNU General Public License v3.0
1.95k stars 291 forks source link

Renotes are sent for translation #2180

Closed jb55 closed 1 month ago

jb55 commented 1 month ago

Reported by: @semisol

It seems we are sending entire repost JSON when translating. Fixing this should reduce our costs by a ton.

jb55 commented 1 month ago

also, did some testing and >=50% of translations seem to be renotes

Semisol commented 1 month ago

By character count, that seems to be 85%.

I would recommend also modifying the backend to stop accepting requests with content that is a note to prevent more costs. My code as an example:

        try {
            let d = JSON.parse(req.body.q)
            if (d.kind && d.id && d.sig && d.pubkey && d.tags) return res.sendError(403, "CONTENT_APPEARS_TO_BE_NOTE")
        } catch {}
jb55 commented 1 month ago

Should be fixed by

jb55 commented 1 month ago

On Mon, Apr 22, 2024 at 05:31:02PM GMT, William Casarin wrote:

Should be fixed by

will update our server in the meantime though

jb55 commented 1 month ago

effectively not a problem anymore