this was originally reported on stackexchange at
but a kern in the thrid argument of \discretionary makes following text be dropped.
In the following plain tex example cult is dropped in all but the last case.
\font\test="Latin Modern Roman:mapping=tex-text" at 12pt
\test
\hsize =2in \advance\hsize by 11pt
shelf{}ful shelf{}ful shelf\-ful di\discretionary{f-}{fi}{f\kern0ptfi}cult task
shelf{}ful shelf{}ful shelf\-ful di\discretionary{f-}{fi}{f\/fi}cult task
shelf{}ful shelf{}ful shelf\-ful di\discretionary{f-}{fi}{f{}fi}cult task
shelf{}ful shelf{}ful shelf\-ful di\discretionary{f-}{fi}{ffi}cult task
di\discretionary{f-}{fi}{ffi}cult task
\bye
Anonymous
I believe this should be fixed by commit 6a6805694f5509fe1c08ef2669ec3f514bc1649d, just pushed to the repository. Testing appreciated!
Tested with TeX Live 2018/pretest, it seems to work.