Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Echo / message error on load failures #672

Closed
Ambrevar opened this issue Apr 18, 2020 · 20 comments
Closed

Echo / message error on load failures #672

Ambrevar opened this issue Apr 18, 2020 · 20 comments
Assignees
Labels
2-series Related to releases whose major version is 2. ffi Renderer-specific quirks.

Comments

@Ambrevar
Copy link
Member

Recipe:

  • disconnect from the Internet.
  • load a page.

We need to tell the user that the page could not be loaded instead of doing nothing, since it's very confusing.

Ideally, the status view should keep the load status displayed since the echoed message is ephemeral.

@Ambrevar Ambrevar added the 2-series Related to releases whose major version is 2. label Apr 18, 2020
@jmercouris
Copy link
Member

Interesting, mine shows an error, says page could not be loaded after some time

@jmercouris
Copy link
Member

Status view is now updated to show when a page is loading. The renderer will try as long as possible, and eventually report an error message. There are no events that should overwrite the status until it is done.

@jmercouris
Copy link
Member

Works as expected:
Screen Shot 2020-04-24 at 13 16 35

@jmercouris
Copy link
Member

I find it hilarious that my interface is half in English and half in Greek :-D

@Ambrevar
Copy link
Member Author

Ambrevar commented Apr 24, 2020 via email

@jmercouris
Copy link
Member

Ah, I see what is happening, that behavior with the background was not intended... :-D

@jmercouris
Copy link
Member

I don't understand your proposed solution, can you explain how that would fix the problem? The real issue is that the status message is currently tied to a window, and not a buffer

@Ambrevar
Copy link
Member Author

Ambrevar commented Apr 24, 2020 via email

@jmercouris
Copy link
Member

print-status would still need to be informed by someone, that would have to be on buffer load. are you suggesting the following:

print-status invoked in buffer load with no arguments
print status default status formatter adds loading if a buffer is currently loading?

@jmercouris
Copy link
Member

By the way, I'm realizing that the current fix is going off topic: the issue is about load failures, e.g. when there is not internet connection. Right now we get buffers like "Internel WebKit error" which means little to the user. What we must do here is handle the load-failed signal.

Strange that it tells you "Internal Webkit Error". For me it says the service or servername could not be resolved (which is what is happening).

@Ambrevar
Copy link
Member Author

Ambrevar commented Apr 24, 2020 via email

@Ambrevar
Copy link
Member Author

Ambrevar commented Apr 24, 2020 via email

@Ambrevar Ambrevar reopened this Apr 25, 2020
@jmercouris
Copy link
Member

The following code:

  (gobject:g-signal-connect
   (gtk-object buffer) "load-failed"
   (lambda (web-view load-event failing-uri error)
     (declare (ignore load-event failing-uri web-view error))
     (print "Load Fail")))

Produces an error:

Unknown GBoxed type 'GError'
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [ABORT] Exit debugger, returning to top level.

Backtrace:
  0: (GOBJECT::GET-G-BOXED-FOREIGN-INFO-FOR-GTYPE #<GTYPE :name "GError" :id 140228195051424>)
  1: ((:METHOD GOBJECT::PARSE-G-VALUE-FOR-TYPE (T (EQL (GOBJECT:GTYPE "GBoxed")))) #.(SB-SYS:INT-SAP #X01F38E68) #<unused argument>) [fast-method]
  2: ((FLET CALL-NEXT-METHOD :IN "/Users/jmercouris/.quicklisp/dists/quicklisp/software/cl-cffi-gtk-20200427-git/gobject/gobject.g-value.lisp"))
  3: ((:METHOD GOBJECT::PARSE-G-VALUE-FOR-TYPE :AROUND (T T)) #.(SB-SYS:INT-SAP #X01F38E68) #<GTYPE :name "GBoxed" :id 72>) [fast-method]
  4: ((SB-PCL::GF-DISPATCH GOBJECT::PARSE-G-VALUE-FOR-TYPE) #.(SB-SYS:INT-SAP #X01F38E68) #<GTYPE :name "GBoxed" :id 72>)
  5: ((:METHOD GOBJECT::PARSE-G-VALUE-FOR-TYPE (T T)) #.(SB-SYS:INT-SAP #X01F38E68) #<GTYPE :name "GError" :id 140228195051424>) [fast-method]
  6: ((FLET CALL-NEXT-METHOD :IN "/Users/jmercouris/.quicklisp/dists/quicklisp/software/cl-cffi-gtk-20200427-git/gobject/gobject.g-value.lisp"))
  7: ((:METHOD GOBJECT::PARSE-G-VALUE-FOR-TYPE :AROUND (T T)) #.(SB-SYS:INT-SAP #X01F38E68) #<GTYPE :name "GError" :id 140228195051424>) [fast-method]
  8: ((SB-PCL::GF-DISPATCH GOBJECT::PARSE-G-VALUE-FOR-TYPE) #.(SB-SYS:INT-SAP #X01F38E68) #<GTYPE :name "GError" :id 140228195051424>)
  9: (GOBJECT:PARSE-G-VALUE #.(SB-SYS:INT-SAP #X01F38E68))
 10: (GOBJECT::PARSE-CLOSURE-ARGUMENTS 4 #.(SB-SYS:INT-SAP #X01F38E20))
 11: ((LAMBDA (GOBJECT::CLOSURE GOBJECT::RETURN-VALUE GOBJECT::COUNT-OF-ARGS GOBJECT::ARGS GOBJECT::INVOCATION-HINT GOBJECT::MARSHAL-DATA) :IN "/Users/jmercouris/.quicklisp/dists/quicklisp/software/cl-cffi..
 12: ((LAMBDA (SB-ALIEN::ARGS-POINTER SB-ALIEN::RESULT-POINTER FUNCTION) :IN "/Users/jmercouris/.quicklisp/dists/quicklisp/software/cl-cffi-gtk-20200427-git/gobject/gobject.signals.lisp") #<unavailable arg..
 13: ("foreign function: funcall_alien_callback")
 14: ("foreign function: #x2010073B")
 15: ("foreign function: #x1CB7E00")
 16: ("foreign function: signal_emit_unlocked_R")
 17: ("foreign function: g_signal_emit_valist")
 18: ("foreign function: g_signal_emit")
 19: ("foreign function: _Z23webkitWebViewLoadFailedP14_WebKitWebView15WebKitLoadEventPKcP7_GError")
 --more--

here is the relevant section of the API:
https://webkitgtk.org/reference/webkit2gtk/stable/WebKitWebView.html#WebKitWebView-load-failed

I believe this is an error in cl-cffi-gtk, I do think we can handle it in cl-webkit

ideas?

@Ambrevar
Copy link
Member Author

Ambrevar commented Apr 30, 2020 via email

@jmercouris
Copy link
Member

I will try to report, and I will try the other cl-cffi-gtk as well, I want to do some more investigation first though

@Ambrevar Ambrevar added the ffi Renderer-specific quirks. label May 10, 2020
@jmercouris jmercouris self-assigned this Apr 5, 2021
@jmercouris
Copy link
Member

BAM!

@jmercouris
Copy link
Member

Screenshot_20210406_142305

@Ambrevar
Copy link
Member Author

Ambrevar commented Apr 6, 2021

Fantastic!

Note for posterity:

  • please mention the commit where this is fixed (here ab813b3).
  • When you upload a submodule, let me know so that I don't forget to update the cl-webkit Guix package.

@jmercouris
Copy link
Member

OK! I will try to do that in the future!

@jmercouris
Copy link
Member

Fixed here: 9a96ff1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-series Related to releases whose major version is 2. ffi Renderer-specific quirks.
Development

Successfully merging a pull request may close this issue.

2 participants