Originally created by: supreme-gg-gg
Describe the bug
Sometimes when link does not have a text body (unknown cause) it does not get displayed properly and you get a placeholder instead. This is done by checking item.text field in messages received.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We should handle these pure url links and display the url instead so the user can click open them. I believe we simply forgot to explicitly handle link type message and it should be a minor fix. Might need to investigate Api results though.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Originally posted by: vitordsb
Oi pessoal! Resolvi dar uma olhada nessa issue. A causa é que, quando o payload do MQTT chega apenas com
item.link(semitem.text), o parser cai direto no placeholder[Sent a link]. Ajusteiinstagram-ts/source/utils/message-parser.tspara inspecionar os dados dolink(url, web_uri, links etc.) e escolher o primeiro URL/texto válido disponível. Com isso o CLI volta a exibir o link clicável e só mantém o placeholder se absolutamente nada vier na resposta.Não consegui rodar
npm run buildaté o fim porque o TypeScript já quebra emsource/client.ts:516(parece ser um erro pré-existente), mas a alteração em si está compilando e resolve o bug nos testes manuais com mensagens de link puro. Posso abrir um PR com essa correção se fizer sentido pra vocês!Originally posted by: supreme-gg-gg
Hey @vitordsb, thanks for your solution! I had to translate it to English so let me know if I understood anything wrong. That sounds like a reasonable cause, definitely open a PR and we will have a look! For the
npm run buildbug, can you provide the specific error logs? The build works fine for me and on CI.Originally posted by: supreme-gg-gg
Hey @vitordsb are you still working on this? Otherwise I will pick this up 😄