Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`RedisList.putFirst(…)` adds the element at the tail of the list

Open
#3,464 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 5 days

@CCCLL is already working on this.

Since Oct 14, 2026.

  • #3465 by @CCCLL — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
30/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java, redis
Domain
databases

Research direction

The bug is in DefaultRedisList.putFirst(…), which delegates to add(…) and so appends with RPUSH; compare it with addFirst(…), offerFirst(…) and push(…) in the same class to see how the front insertion is done. The existing testPutFirst() in AbstractRedisListIntegrationTests calls testAdd() and never exercises putFirst(…), so it needs a real assertion. Done means putFirst puts the element at the head and reversed().putLast(…) gives the expected order. A linked pull request (#3465) is already open, so check it before starting.

Written by the indexing model from the issue text.

Description

status: waiting-for-triage

DefaultRedisList.putFirst(…) delegates to add(…), which appends the element with RPUSH:

public void putFirst(E element) {
	add(element);
}

BlockingDeque.putFirst(…) inserts the element at the front of the deque, like addFirst(…), offerFirst(…) and push(…) of DefaultRedisList do:

RedisList<String> list = RedisList.create("list", template); // [1, 2]

list.putFirst("0"); // [1, 2, 0], expected [0, 1, 2]

The view returned by RedisList.reversed() implements putLast(…) through putFirst(…) of the underlying list, so it is affected as well:

RedisList<String> reversed = list.reversed(); // [2, 1]

reversed.putLast("0"); // [0, 2, 1], expected [2, 1, 0]

Reproduced on main against Redis 8.6.2 with Lettuce and Jedis. The method has delegated to add(…) since RedisList became a BlockingDeque, so 3.5.x, 4.0.x and 4.1.x contain the same code. The existing testPutFirst() in AbstractRedisListIntegrationTests calls testAdd() and never invokes putFirst(…), so the behavior is not covered by a test. I will submit a PR with a fix and tests.

Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-projects/spring-data-redis

All issues in spring-projects/spring-data-redis

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.