dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.82k stars 773 forks source link

Confusing redirect to Bing homepage from F# compiler warning message #14481

Open loop-evgeny opened 1 year ago

loop-evgeny commented 1 year ago

Warning FS3536 (see #14480) contains the following in its message:

See https://aka.ms/fsharp-iwsams for guidance

When you actually browse to that redirect you get redirected to a blank Bing page! This is really confusing UX.

Note that this issue is not just about fixing that specific redirect, though of course it should be fixed - it's about the general policy of redirecting to Bing for any URLs that don't exist.

Repro steps

Browse to https://aka.ms/fsharp-iwsams

Expected behavior

A page related to warning FS3536 or a proper error page if no such page exists, saying something along the lines of "This F# documentation page could not be found. Please report this as a bug at https://github.com/dotnet/fsharp/issues"

Actual behavior

I am redirected to https://www.bing.com/?ref=aka&shorturl=fsharp-iwsams

baronfel commented 1 year ago

I'm pretty sure the bing redirect is just how aka.ms works when there is no matching redirect. I don't think there's a question of policy that needs to be answered here, I think this one redirect needs to be created and filled in.

vzarytovskii commented 1 year ago

I'm pretty sure the bing redirect is just how aka.ms works when there is no matching redirect. I don't think there's a question of policy that needs to be answered here, I think this one redirect needs to be created and filled in.

Yeah, it's the default aka.ms behaviour, I think we haven't published the doc anywhere (in fact we don't have one yet).

jimfoye commented 1 year ago

I think that's why HTTP error 404 was invented.

bmitc commented 1 month ago

Does anyone know where https://aka.ms/fsharp-iwsams originally pointed to? I am assuming that it pointed to the RFC for the IWSAM feature, perhaps to the Warning when using IWSAMs as types subsection.

It seems the easiest fix would be for a Microsoft employee to recreate the https://aka.ms/fsharp-iwsams link and point it somewhere, as that would require no code changes.

But I am curious: what is the general strategy or guidance for:

  1. providing links in warning or error messages, and
  2. documenting compiler warnings and errors

in F#? The various warnings and errors aren't fully documented, and it can take some searching around to find out more information.

One possible solution, from the perspective of just a user of F#, is to more diligently create sections in the F# compiler messages for each compiler warning or error. Then either a link to the relevant entry could be provided in the warning message or no link at all since it would make searching for the specific code easier. The entry for the code could link out to more documentation, such as RFCs. Thoughts on this?

Another thing that I've seen that makes it hard to search for these is various formats. For example, warning FS0009 might be mentioned as FS0009, FS9, 0009, or just 9. I can't remember exactly where I've seen the different formats, but I do feel I have seen them.

vzarytovskii commented 1 month ago

It didn't point anywhere, we made a placeholder for someone to write an explainer for it. We should just remove the link from the error message (unless someone wants to take a stab at writing a user guide).

loop-evgeny commented 1 month ago

Existing compiler versions already have the link, though. Even a simple page would be better than nothing. It is quite a confusing error.

Also, do you really have to use aka.ms when it provides such bad UX? The URL doesn't have to be super-short.

vzarytovskii commented 1 month ago

Even a simple page would be better than nothing. It is quite a confusing error.

Sure, somebody needs to write it in simple enough language though.

Also, do you really have to use aka.ms when it provides such bad UX? The URL doesn't have to be super-short.

Yes, that's the only easy to manage links, urls on GitHub change, get updated, etc. I, for now, directed it to the RFC.

abelbraaksma commented 1 month ago

for now, directed it to the RFC.

Confirmed. It goes here: https://github.com/fsharp/fslang-design/blob/main/FSharp-7.0/FS-1124-interfaces-with-static-abstract-members.md#warning-when-using-iwsams-as-types.

I think that's a pretty good solution, should we close?