AmbireTech / adex-platform

AdEx Platform UI
https://platform.adex.network
GNU General Public License v3.0
58 stars 19 forks source link

Better validation of description on the frontend #161

Closed TRtomasz closed 4 years ago

TRtomasz commented 4 years ago

Description It is possible to send following Ad_unit without an error on the frontend. If description cause internal server error on the backend error message should be displayed on the frontend. Also it should not end in internal server error, we should return message about wrong description. This should be provided for every field that requires user input. {"type":"legacy_120x60","mediaUrl":"ipfs://QmbUERnXz3truLbSGqM6P9CoVUmwGKNnizj4xv3ARJ9pYs","mediaMime":"image/jpeg","targetUrl":"https://www.onet.pl","targeting":[{"tag":"gender_male","score":100},{"tag":"gender_female","score":100}],"tags":[],"title":"ed862fda23faabdc6b52c388ab3267c450944f2b","description":" \"👩🏽\", \n \"👾 🙇 💁 🙅 🙆 🙋 🙎 🙍\", \n \"🐵 🙈 🙉 🙊\", \n \"❤️ 💔 💌 💕 💞 💓 💗 💖 💘 💝 💟 💜 💛 💚 💙\"\n \"Ṱ̺̺̕o͞ ̷i̲̬͇̪͙n̝̗͕v̟̜̘̦͟o̶̙̰̠kè͚̮̺̪̹̱̤ ̖t̝͕̳̣̻̪͞h̼͓̲̦̳̘̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ͏͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣\", \n \"̡͓̞ͅI̗̘̦͝n͇͇͙v̮̫ok̲̫̙͈i̖͙̭̹̠̞n̡̻̮̣̺g̲͈͙̭͙̬͎ ̰t͔̦h̞̲e̢̤ ͍̬̲͖f̴̘͕̣è͖ẹ̥̩l͖͔͚i͓͚̦͠n͖͍̗͓̳̮g͍ ̨o͚̪͡f̘̣̬ ̖̘͖̟͙̮c҉͔̫͖͓͇͖ͅh̵̤̣͚͔á̗̼͕ͅo̼̣̥s̱͈̺̖̦̻͢.̛̖̞̠̫̰\", \n \"̗̺͖̹̯͓Ṯ̤͍̥͇͈h̲́e͏͓̼̗̙̼̣͔ ͇̜̱̠͓͍ͅN͕͠e̗̱z̘̝̜̺͙p̤̺̹͍̯͚e̠̻̠͜r̨̤͍̺̖͔̖̖d̠̟̭̬̝͟i̦͖̩͓͔̤a̠̗̬͉̙n͚͜ ̻̞̰͚ͅh̵͉i̳̞v̢͇ḙ͎͟-҉̭̩̼͔m̤̭̫i͕͇̝̦n̗͙ḍ̟ ̯̲͕͞ǫ̟̯̰̲͙̻̝f ̪̰̰̗̖̭̘͘c̦͍̲̞͍̩̙ḥ͚a̮͎̟̙͜ơ̩̹͎s̤.̝̝ ҉Z̡̖̜͖̰̣͉̜a͖̰͙̬͡l̲̫̳͍̩g̡̟̼̱͚̞̬ͅo̗͜.̟\", \n \"̦H̬̤̗̤͝e͜ ̜̥̝̻͍̟́w̕h̖̯͓o̝͙̖͎̱̮ ҉̺̙̞̟͈W̷̼̭a̺̪͍į͈͕̭͙̯̜t̶̼̮s̘͙͖̕ ̠̫̠B̻͍͙͉̳ͅe̵h̵̬͇̫͙i̹͓̳̳̮͎̫̕n͟d̴̪̜̖ ̰͉̩͇͙̲͞ͅT͖̼͓̪͢h͏͓̮̻e̬̝̟ͅ ̤̹̝W͙̞̝͔͇͝ͅa͏͓͔̹̼̣l̴͔̰̤̟͔ḽ̫.͕\", \n \"Z̮̞̠͙͔ͅḀ̗̞͈̻̗Ḷ͙͎̯̹̞͓G̻O̭̗̮\", ","archived":false,"passback":false,"created":1570103781323}

rori4 commented 4 years ago

This is validated by with the models so adding this shouldn't cause an error in the back-end if you are able to add it in the fronted. @TRtomasz When you tried adding this did you see and internal server error?

TRtomasz commented 4 years ago

Yes @rori4 there was internal server error, but since it cause error on backend it shouldn't be allowed on the frontend to avoid confusion for users

rori4 commented 4 years ago

@TRtomasz I am unable to reproduce this. I have tried adding the an AdUnit with the same description but the validation prevents from having descriptions over 300 chars. Can you provide steps to reproduce this?

TRtomasz commented 4 years ago

Looks like it has been fixed. When amount of characters is reduced to 300 there is no internal server error.

rori4 commented 4 years ago

Great. Thanks for checking on this. I will close it now

ivopaunov commented 4 years ago

Actually, maybe you had older version. it was fixed with https://github.com/AdExNetwork/adex-platform/commit/aae2d826cd51329fe4309b2c6783b15eb6f642e2 but I didn't remember that when you opened the issue ...