79748568

Date: 2025-08-28 00:59:30
Score: 1.5
Natty:
Report link

THE PROBLEM (aka what you did):

you're calling:

this.service.delete3("http://localhost:4200/").subscribe({
    next: () => { console.log("test4"); },
    error: () => { console.log("error test3"); }
});

You think it should log test4. But it doesn't... WHY????

THE FACEPALM MOMENT

Let's look inside delete3 in your service:

delete3(path: string): Observable<Company> { 
    console.log("delete3");
    return this.http.delete<Company>(path);
}

You're logging "delete3" inside the function, not in the subscription. so if you never see "delete3" in console, it means..

drumroll please***

THE FUNCTION IS NEVER EVEN CALLED!!!!!! Like bro....... you thought you were calling it, but something else is broken and delete3() isn't even being triggered. So OF COURSE "test4" never shows up either.... you're not even getting to the .subscribe() block

HOW TO DEBUG THIS IS DUMB-EASY STEPS

  1. Add a log before the serice call:
console.log("about to call delete3");
this.service.delete3("http://localhost:4200/").subscribe({
    next: () => { console.log("test4"); },
    error: () => { console.log("error test3"); }
});

if you don't even see "about to call delete3" you're not reaching this part of code. Maybe some condition blocks it or user din't trigger it right.

WHY THE DELETE WORKS BUT CALLBACK DOESN'T

HTTP DELETE (and POST/PUT) will still send the request... even if you dont subscribe() to it. But unless you subscribe(), the callback like next: () => {...} won't run.

BUT WAIT... you are subscribing here. So thats not the issue

SOOOOO whats really happening is:

HOW TO CLEAN THIS MESS UP:

add some logs bro..

console.log("DELETE 1 start");
this.http.delete("http://localhost:4200/").subscribe({
    next: () => { console.log("test"); },
    error: () => { console.log("error test"); }
});

console.log("DELETE 2 start");
this.delete2("http://localhost:4200/").subscribe({
    next: () => { console.log("test2"); },
    error: () => { console.log("error test2"); }
});

console.log("DELETE 3 start");
this.service.delete3("http://localhost:4200/").subscribe({
    next: () => { console.log("test4"); },
    error: () => { console.log("error test3"); }
});

Now run it. Whichever "start" logs and whhichever domn't will tell what's actually being called.

TL;DR FOR THE LAZY Bro test4 isnt logging because youre not even calling the service methd. You thought you were, but youre not. its like saying your microwave is broken, but you never plugged it in.

so yeah... super obvs lol

Reasons:
  • Blacklisted phrase (1): ???
  • Blacklisted phrase (0.5): WHY?
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: gerthardthydestroyer_xXxxXx_HD