Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Problem query runs with beforeTime and afterTime, with exact time in minutes

未关闭
#565 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
api, backend

调研方向

从 TasksApiImpl.java:501 开始,其中 TaskApi#getRuns 出现在堆栈跟踪中,并检查 InfluxDbClientTest.java:459 中相关的调用。复现 afterTime 和 beforeTime 恰好处于同一分钟的情况,然后添加或更新回归测试,以展示请求在没有 BadRequestException 的情况下返回 runs。

由索引模型根据 Issue 内容生成。

描述

When execute TaskApi#getRuns with beforeTime and afterTime on exact time in minutes, it throws BadRequestException and can not get result.

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. Set afterTime and beforeTime, with exact time
OffsetDateTime afterTime = OffsetDateTime.parse("2023-05-20T10:15:00+09:00");
OffsetDateTime beforeTime = OffsetDateTime.parse("2023-05-20T11:15:00+09:00");
Integer limit = 100;


InfluxDBClient client = getClient();
client.getTasksApi().getRuns(task.getId(), afterTime, beforeTime, limit);

Expected behavior:
Returns the runs without error, executed between afterTime and beforeTime.

Actual behavior:
Got BadGrammerExeception.

The reason is, TaskApi#getRuns ( and InfluxDB itself) expects afterTime and beforeTime as strictly rfc3339 format, but parameter value type is OffsetDateTime which is ISO-8601 format. Therefore, it formats timestamp as ISO-8601 format omitting some part when the timestamp is exact minute time.

HTTP status code: 400; Message: failed to decode request: parsing time "2023-05-20T10:15+09:00" as "2006-01-02T15:04:05Z07:00": cannot parse "+09:00" as ":"
com.influxdb.exceptions.BadRequestException: HTTP status code: 400; Message: failed to decode request: parsing time "2023-05-20T10:15+09:00" as "2006-01-02T15:04:05Z07:00": cannot parse "+09:00" as ":"
	at com.influxdb.internal.AbstractRestClient.responseToError(AbstractRestClient.java:113)
	at com.influxdb.internal.AbstractRestClient.execute(AbstractRestClient.java:84)
	at com.influxdb.client.internal.TasksApiImpl.getRuns(TasksApiImpl.java:501)
	at jp.co.iim.collie.ui.common.repository.influxdb.InfluxDbClientTest.taskTest(InfluxDbClientTest.java:459)

Specifications:

  • Client Version: 6.7.0
  • InfluxDB Version: InfluxDB 2.1.1
  • JDK Version: OpenJDK 1.8.0_281
  • Platform: CentOS 7
主要语言
Java
星标
477
派生
129
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

influxdata/influxdb-client-java 的其他 Issue

查看 influxdata/influxdb-client-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。