Research results obsolete while publishing Consider the following situation. Scientist A obtained a novel cool result and submitted it to a respected journal after putting the preprint to arXiv. The journal started the peer review process which will take 2 years. During this time scientist B drastically enhanced A's achievements thus making them obsolete. B also put his preprint to arXiv, so the reviewers can easily access it too.

What will happen then? Will the journal publish A's work? If not, why?
And what should A do to have any credit for his (pioneer) work?
There is no way to predict what will happen to your paper or whether
you will get credit you find satisfactory. If B is a decent person
he/she will choose to to make some acknowledgement of your prior or concurrent work. 

This cannot be the first instance of such competing claims for priority.
Your journal may have a policy
on handing such situations, and it would not hurt to ask, as long
as your request doesn't appear to put blame on the journal for delaying
your paper.

You don't say what field of science is involved. Does your paper use
different methods than B's? Methods which are not made obsolete by
B's paper and might lead to other developments? Does anything remain
of your paper that is not superseded by B;s? If so maybe you'll be
asked to revise your paper to highlight what has not been 'scooped'.

In some fields I know of cases in which journal editors worked out
an arrangement for one or two joint paper(s), pretty much to the satisfaction of all. Obviously,
that would not always be possible.