glific icon indicating copy to clipboard operation
glific copied to clipboard

Add media type to message media url

Open pankaj-ag opened this issue 3 years ago • 1 comments

Currently we don't have a message media type on the message media URL and we always have to link to message just for the type. We need to do two things.

  1. Add media_type column to message media table (nullable)
  2. Get type from the URL and update the existing one.

pankaj-ag avatar Aug 28 '22 17:08 pankaj-ag

@pankaj-ag as media table is linked with messages. We already have information about media type in the messages table. Wouldn't it be an identical column repeated?

AkhileshNegi avatar Sep 07 '22 04:09 AkhileshNegi

gupshup does not give us the type of media file when we xfer to GCS, we determine the type seems like they recently added contentType check: https://www.gupshup.io/developer/docs/bot-platform/guide/whatsapp-api-documentation#media we should add this to the messagesMedia table

pankaj-ag avatar Dec 27 '22 04:12 pankaj-ag

also media type is different from content type which is a mime type

dlobo avatar Apr 03 '23 02:04 dlobo

@AkhileshNegi I thought I close this issue or updated the comment.

There was a use case where we need to have a media type (in search or somewhere else) and do that we always join that table to messages which is a huge table. So to remove that join just for the type I thought let's save the media type here as well.

But later I thought the content type would be better info to store in the database.

pankaj-ag avatar Apr 03 '23 03:04 pankaj-ag