Ajax: publish a topic when a call waits in its channel's queue, and when a call is dropped without being sent
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java, javascript
Direzione di ricerca
Start with wicket-ajax.js, especially Wicket.Ajax.Call#ajax, Wicket.Channel, and Wicket.Throttler; trace how calls are queued, replaced, or ignored. Then inspect IAjaxCallListener, AjaxCallListener, and PageVeilBehavior for how existing topics are declared and handled. Done means the queued and dropped topics report the described call details and reasons, with the stated exactly-once completion guarantee.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Affects: 11.0.0 and current master; the same code in 10.x.
Component: wicket-core, wicket-ajax.js (Wicket.Ajax.ajax, Wicket.Ajax.Call#ajax, Wicket.Channel, Wicket.Throttler), IAjaxCallListener; wicket-extensions, PageVeilBehavior
What happens
A script cannot follow an Ajax call from the moment it is asked for to the moment it ends, because some of the call's life is never published:
-
/ajax/call/initis published only by the handlersWicket.Ajax.ajaxbinds to events, before throttling. A call made withWicket.Ajax.get/postornew Wicket.Ajax.Call().ajax(attrs)publishes nothing untildoAjaxruns. -
Wicket.Ajax.Call#ajaxhands the call to its channel. When the channel is busy, the call waits in its queue (s), replaces the calls waiting there (d), or is ignored (a). Nothing is published for any of these. -
/ajax/call/beforethrough/ajax/call/doneare published fromdoAjax, which runs only once the channel is free. -
Some calls never run, and publish nothing at all, not even
/ajax/call/done:- a call dropped from a
dchannel's queue; - a call ignored by an
achannel; - a throttled call replaced by a later one (
Wicket.Throttler#throttle,entry.setFunc(func)).
A call stopped by its precondition does publish
done. - a call dropped from a
So init misses calls, and is not always followed by done. beforeSend comes after the call has waited in the queue.
Why it matters
The page veil of PageVeilBehavior (#1631) goes up at /ajax/call/beforeSend. Suppose a request that is not veiled is running: a filter, a timer, or a call with wicket_nb. A click on a button then waits in the channel's queue with no veil over the page, and a second click waits behind it. Once the channel is free, both run, and the action runs twice. That is the case the veil is there for.
Raising the veil at /ajax/call/init instead does not work either. After a throttled or dropped call it stays up for good, since no topic tells it the call is gone. The same holds for any busy indicator, or a guard against double submits, written on the global topics.
Proposal
Two topics, with their handlers in IAjaxCallListener and AjaxCallListener like the other topics:
-
/ajax/call/queued(Wicket.Event.Topic.AJAX_CALL_QUEUED): published when the channel makes the call wait behind a running one. The call's attributes and the channel's name are passed with it. The handler isgetQueuedHandler(Component)/onQueued(...). -
/ajax/call/dropped(Wicket.Event.Topic.AJAX_CALL_DROPPED): published when a call will never run, for any of these reasons:- removed from a
dchannel's queue; - ignored by an
achannel; - replaced in the throttler.
The dropped call's attributes and the reason are passed with it. The handler is
getDroppedHandler(Component)/onDropped(...). - removed from a
The guarantee that comes with them: every call that publishes init or queued ends with exactly one done or dropped.
PageVeilBehavior could then raise its veil at init or queued, for the calls not opted out, and lower it at done or dropped. A click waiting behind another request is then veiled, and so is the click that would queue behind it.
Workaround
Today the only way is to wrap Wicket.Channel.prototype.schedule and Wicket.Throttler.prototype.throttle, which are internal and may change.
Found while working on reiern70/advanced-widgets#141.
- Lingua principale
- Java
- Stelle
- 800
- Fork
- 437
- Merge medio
- 21h 36m
- PR unite (30g)
- 167
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/wicket
-
PropertyResolver fails on JDK classes with a non-public field named like the propertyForse già presa @vaibhavgupta443 l’ha presa oggi. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/wicket#1991 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Stop the autocomplete from accumulating request parameters while typingForse già presa @aryankalantri l’ha presa oggi. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/wicket#1947 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Validate the report-uri value given to CSPHeaderConfiguration#reportBackForse già presa @AzizOuertani l’ha presa 3 giorni fa. Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/wicket#1946 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/wicket
Issue simili
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
I maintainer di solito rispondono entro 6 giorni
-
account assessment course feature lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 连接达梦时报错,agent 进程启动即退Apertabug db/dameng user-priority/P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
app:learninggoalhub enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100