console icon indicating copy to clipboard operation
console copied to clipboard

🐛 Bug Report: Adding Invalid Domain to Function Doesn't Throw an Error

Open ItzNotABug opened this issue 10 months ago • 6 comments

👟 Reproduction steps

Assuming you have a Function in your Project.


  1. Go to Console > Project
  2. Navigate to Functions & Select your Function
  3. Navigate to the Domains Tab & Click on Create Domain
    • Write a domain associated with main domain i.e. appwrite.io or cloud.appwrite.io & click on Next
    • OR Use any domain you like with http:// or https://
  4. Message shows -
    ✅ Domain verified
    
    🕓 Certificate generation will begin after domain verification
    

The API call returns an error like this -

  1. For first scenario i.e. wrong domain -

    {
      "message": "You cannot assign your main domain to specific resource. Please use subdomain or a different domain.",
      "code": 400,
      "type": "general_argument_invalid",
      "version": "0.12.143"
    }
    
  2. For second scenario i.e. with http* prefix -

    {
      "message": "Domain may not start with http:\/\/ or https:\/\/.",
      "code": 400,
      "type": "general_argument_invalid",
      "version": "0.12.143"
    }
    

👍 Expected behavior

Use the returned Error and show message to the user.

👎 Actual Behavior

Shows Domain verified even in case of errors.

🎲 Appwrite version

Appwrite Cloud

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

ItzNotABug avatar Apr 11 '24 08:04 ItzNotABug

@ItzNotABug, thanks for raising this issue! 🙏🏼 Is this still a problem on 1.5? I think it should have been fixed as part of https://github.com/appwrite/appwrite/issues/5936

stnguyen90 avatar Apr 11 '24 22:04 stnguyen90

@stnguyen90 Issue exists on 1.5.4 too.


Findings on 1.5.4 -

  1. Using main domain still works as described above. No error is shown
  2. The second case is handled via the input pattern validation but remove the validation manually and submit the domain, the issue persists

ItzNotABug avatar Apr 12 '24 05:04 ItzNotABug

Ahhh I see. We're catching the exception:

https://github.com/appwrite/console/blob/ad764b6265a62bde019f7d9602b871f35c7dc27a/src/lib/pages/domains/wizard/step1.svelte#L29-L32

So the wizard proceeds to the next step.

stnguyen90 avatar Apr 15 '24 17:04 stnguyen90

can I pick this bug?

tewarig avatar Apr 15 '24 19:04 tewarig

@tewarig, assigned! Thanks for your interest!

stnguyen90 avatar Apr 16 '24 23:04 stnguyen90

Unassigning due to inactivity.

stnguyen90 avatar May 03 '24 21:05 stnguyen90

@stnguyen90 Could you please assign this to me?

Manjunath0408 avatar May 31 '24 10:05 Manjunath0408