repo string | pull_number int64 | instance_id string | issue_numbers list | base_commit string | patch string | test_patch string | problem_statement string | hints_text string | created_at timestamp[ns, tz=UTC] | version float64 |
|---|---|---|---|---|---|---|---|---|---|---|
assertj/assertj | 3,820 | assertj__assertj-3820 | [
"2631"
] | 8f5c6b7d4a6994a234c21e736057d987679def77 | diff --git a/assertj-core/src/main/java/module-info.java b/assertj-core/src/main/java/module-info.java
--- a/assertj-core/src/main/java/module-info.java
+++ b/assertj-core/src/main/java/module-info.java
@@ -18,6 +18,7 @@
// AssertJ Core's package API
exports org.assertj.core.annotations;
exports org.assertj.co... | diff --git a/assertj-core/src/test/java/org/assertj/core/api/AbstractAssert_areEqual_Test.java b/assertj-core/src/test/java/org/assertj/core/api/AbstractAssert_areEqual_Test.java
deleted file mode 100644
--- a/assertj-core/src/test/java/org/assertj/core/api/AbstractAssert_areEqual_Test.java
+++ /dev/null
@@ -1,59 +0,0 ... | Expose `ComparisonStrategy` for third-party usage
Currently, `ComparisonStrategy` is part of the internal package and there is no easy way to access it. This limits extension capabilities in JPMS and OSGi applications.
Exposing `ComparisonStrategy` in `AbstractAssert` would be handy for the implementation of custom ... | Targeting 4.x being a breaking change. | 2025-04-09T20:27:10Z | 4 |
assertj/assertj | 3,735 | assertj__assertj-3735 | [
"3733"
] | e5959f4db0cea3b3be39e6dcdf451da971b9ae49 | diff --git a/assertj-core/src/main/java/org/assertj/core/error/BasicErrorMessageFactory.java b/assertj-core/src/main/java/org/assertj/core/error/BasicErrorMessageFactory.java
--- a/assertj-core/src/main/java/org/assertj/core/error/BasicErrorMessageFactory.java
+++ b/assertj-core/src/main/java/org/assertj/core/error/Bas... | diff --git a/assertj-core/src/test/java/org/assertj/core/error/BasicErrorMessageFactory_unquotedString_Test.java b/assertj-core/src/test/java/org/assertj/core/error/BasicErrorMessageFactory_unquotedString_Test.java
--- a/assertj-core/src/test/java/org/assertj/core/error/BasicErrorMessageFactory_unquotedString_Test.java... | Unquoted string produced by BasicErrorMessageFactory is quoted by StandardRepresentation in 3.27.x
**Describe the bug**
https://github.com/assertj/assertj/pull/3617 has introduced a regression in `StandardRepresentation` when handling an `UnquotedString`. `UnquotedString` implements `CharSequence` so it's now handled ... | Good catch thanks @wilkinsona | 2025-01-08T22:44:11Z | 3.27 |
assertj/assertj | 3,724 | assertj__assertj-3724 | [
"3722"
] | 9cf73ca09df697516a4295ee8db99520afbb116d | diff --git a/assertj-core/src/main/java/org/assertj/core/api/recursive/comparison/RecursiveComparisonDifferenceCalculator.java b/assertj-core/src/main/java/org/assertj/core/api/recursive/comparison/RecursiveComparisonDifferenceCalculator.java
--- a/assertj-core/src/main/java/org/assertj/core/api/recursive/comparison/Re... | diff --git a/assertj-tests/assertj-integration-tests/assertj-core-tests/src/test/java/org/assertj/tests/core/api/recursive/comparison/RecursiveComparisonAssert_isEqualTo_ignoringFields_Test.java b/assertj-tests/assertj-integration-tests/assertj-core-tests/src/test/java/org/assertj/tests/core/api/recursive/comparison/Re... | `ignoringFields` on recursive comparison no longer works with maps with null values
**Describe the bug**
As part of solving https://github.com/assertj/assertj/issues/2988, https://github.com/assertj/assertj/commit/835c1dc3aee2348eb234f3209488fdd078702c2f changed how maps were checked for equality with a new `filterIgn... | Thanks for the reproducer, @grantaveryatgfs! We'll look into it. | 2025-01-03T08:46:24Z | 3.27 |
assertj/assertj | 3,325 | assertj__assertj-3325 | [
"3322"
] | 1d96ab855fa2c70534dbd5373220c75203e7d8ee | diff --git a/assertj-core/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java b/assertj-core/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java
--- a/assertj-core/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java
+++ b/assertj-core/src/main/java/org/assertj/core/api/Instance... | diff --git a/assertj-core/src/test/java/org/assertj/core/api/Assertions_sync_with_InstanceOfAssertFactories_Test.java b/assertj-core/src/test/java/org/assertj/core/api/Assertions_sync_with_InstanceOfAssertFactories_Test.java
--- a/assertj-core/src/test/java/org/assertj/core/api/Assertions_sync_with_InstanceOfAssertFact... | Improve interoperability of `asInstanceOf` with `Set` instances
Right now, there is no nice way to call `asInstanceOf` when a `Set` instance is expected.
Current solutions:
```java
Object actual = Set.of("first", "second");
assertThat(actual)
.asInstanceOf(InstanceOfAssertFactories.type(Set.class))
.sat... | 2024-01-07T13:19:44Z | 3.25 | |
assertj/assertj | 3,318 | assertj__assertj-3318 | [
"3314"
] | 887f97b65da068e03308a6373a0c8a76912377aa | diff --git a/assertj-core/src/main/java/org/assertj/core/api/Assertions.java b/assertj-core/src/main/java/org/assertj/core/api/Assertions.java
--- a/assertj-core/src/main/java/org/assertj/core/api/Assertions.java
+++ b/assertj-core/src/main/java/org/assertj/core/api/Assertions.java
@@ -12,7 +12,6 @@
*/
package org.a... | diff --git a/assertj-core/src/test/java/org/assertj/core/api/Assertions_assertThatThrownBy_Test.java b/assertj-core/src/test/java/org/assertj/core/api/Assertions_assertThatThrownBy_Test.java
--- a/assertj-core/src/test/java/org/assertj/core/api/Assertions_assertThatThrownBy_Test.java
+++ b/assertj-core/src/test/java/or... | Compile error due to new assertThatThrownBy
**Describe the bug**
Compile error in Eclipse 2023-12: The method assertThatThrownBy(ThrowableAssert.ThrowingCallable) is ambiguous for the type AmbigiousCallTest.
The only change is the upgrade from 3.24.2 to 3.25. In 3.24.2 the same code was fine.
* assertj core vers... | Thanks for reporting it, @Bananeweizen.
We're in discussion with the team if we should revert cf06398587da23ac530b03a941e0efe6cf29aef7 as it introduced a breaking change we didn't spot before.
My code also doesn't compile after upgrading to AssertJ 3.25.0,
BUT
@scordio I would like to mention that this is not a ... | 2024-01-02T21:28:12Z | 3.25 |
assertj/assertj | 3,691 | assertj__assertj-3691 | [
"1355"
] | 62273fc8c0989c465d11814b450ac5836ee00a94 | diff --git a/assertj-core/src/main/java/org/assertj/core/error/ShouldNotContainCharSequence.java b/assertj-core/src/main/java/org/assertj/core/error/ShouldNotContainCharSequence.java
--- a/assertj-core/src/main/java/org/assertj/core/error/ShouldNotContainCharSequence.java
+++ b/assertj-core/src/main/java/org/assertj/co... | diff --git a/assertj-core/src/test/java/org/assertj/core/error/ShouldNotContainThrowable_create_Test.java b/assertj-core/src/test/java/org/assertj/core/error/ShouldNotContainThrowable_create_Test.java
--- a/assertj-core/src/test/java/org/assertj/core/error/ShouldNotContainThrowable_create_Test.java
+++ b/assertj-core/s... | Describe actual Throwables when ThrowableAssert fails
### Summary
When some `Throwable`-related assertion fails the actual `Throwable` that failed the check is not described beyond what actually caused assertion failure (e.g. message mismatch). In non-trivial code when unexpected `Exception`s are thrown this makes deb... | do you mean printing the stack trace at the end of the error message ?
can you give an example of what you would ideally have ?
Example of my ideal message:
```java
Expecting Throwable message:
<"expected exception message">
but was:
<"some other unexpected exception">
Throwable that failed the check:
Excep... | 2024-12-07T16:52:07Z | 3.26 |
assertj/assertj | 3,120 | assertj__assertj-3120 | [
"3113"
] | 2ee04f4a24562a3091af70f815fb07da3ae149ac | diff --git a/assertj-core/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java b/assertj-core/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java
--- a/assertj-core/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java
+++ b/assertj-core/src/main/java/org/assertj/core/api/Abstr... | diff --git a/assertj-core/src/test/java/org/assertj/core/api/CharSequenceAssertBaseTest.java b/assertj-core/src/test/java/org/assertj/core/api/CharSequenceAssertBaseTest.java
--- a/assertj-core/src/test/java/org/assertj/core/api/CharSequenceAssertBaseTest.java
+++ b/assertj-core/src/test/java/org/assertj/core/api/CharS... | isEqualToNormalizingWhitespace doesn't normalise non breaking space characters
**Describe the bug**
isEqualToNormalizingWhitespace doesn't normalise non breaking space characters
* assertj core 3.21:
* java version: 17
* Kotlin 1.9.0
* test framework version: JUnit 5.9.1
* os (if relevant):
**Compare 2 stri... | That's a bit weird since the [implementation](https://github.com/assertj/assertj/blob/776b46c514c4336c58a643fb08bf61a1ac6cb9b3/assertj-core/src/main/java/org/assertj/core/internal/Strings.java#L455) detects the whitespace characters according to the JDK `Character` method [isWhitespace](https://docs.oracle.com/en/java/... | 2023-07-24T09:02:08Z | 3.24 |
assertj/assertj | 3,056 | assertj__assertj-3056 | [
"3048"
] | 9902a7ac2f3d1002dafd70fa1e79ffa1416f571f | diff --git a/assertj-core/src/main/java/org/assertj/core/api/AbstractClassAssert.java b/assertj-core/src/main/java/org/assertj/core/api/AbstractClassAssert.java
--- a/assertj-core/src/main/java/org/assertj/core/api/AbstractClassAssert.java
+++ b/assertj-core/src/main/java/org/assertj/core/api/AbstractClassAssert.java
@... | diff --git a/assertj-core/src/test/java/org/assertj/core/api/classes/ClassAssert_hasNoPackage_Test.java b/assertj-core/src/test/java/org/assertj/core/api/classes/ClassAssert_hasNoPackage_Test.java
new file mode 100644
--- /dev/null
+++ b/assertj-core/src/test/java/org/assertj/core/api/classes/ClassAssert_hasNoPackage_T... | `hasNoPackage()` assertion for arrays and primitive types
**Describe the bug**
[`Class::getPackage`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html#getPackage()) mentions:
> If this class represents an array type, a primitive type or void, this method returns `null`.
However,... | Rather than changing the behavior of `hasPackage(Package)` and potentially `hasPackage(String)`, we should probably add a new `hasNoPackage()` assertion, in the style of [`hasNoSuperclass()`](https://www.javadoc.io/doc/org.assertj/assertj-core/latest/org/assertj/core/api/AbstractClassAssert.html#hasNoSuperclass()). | 2023-05-21T09:55:41Z | 3.24 |
assertj/assertj | 2,726 | assertj__assertj-2726 | [
"2692"
] | 01e395a70ca4166ecec562efe0992b7282e45194 | diff --git a/assertj-core/src/main/java/org/assertj/core/condition/NestableCondition.java b/assertj-core/src/main/java/org/assertj/core/condition/NestableCondition.java
new file mode 100644
--- /dev/null
+++ b/assertj-core/src/main/java/org/assertj/core/condition/NestableCondition.java
@@ -0,0 +1,179 @@
+/*
+ * License... | diff --git a/assertj-core/src/test/java/org/assertj/core/condition/NestableConditionFixtures.java b/assertj-core/src/test/java/org/assertj/core/condition/NestableConditionFixtures.java
new file mode 100644
--- /dev/null
+++ b/assertj-core/src/test/java/org/assertj/core/condition/NestableConditionFixtures.java
@@ -0,0 +... | Add building block to create custom precise assertions
#### Check List:
* Unit tests : YES
* Javadoc with a code example (on API only) : YES
* PR meets the [contributing guidelines](https://github.com/assertj/assertj-core/blob/main/CONTRIBUTING.md)
The goal is to be able to make precise soft assertions on complex... | 2022-08-01T10:38:38Z | 3.23 | |
assertj/assertj | 2,685 | assertj__assertj-2685 | [
"2666"
] | d5180a6d7c1af6ac7272268ee87dad54ae01ee7c | diff --git a/src/main/java/org/assertj/core/internal/Strings.java b/src/main/java/org/assertj/core/internal/Strings.java
--- a/src/main/java/org/assertj/core/internal/Strings.java
+++ b/src/main/java/org/assertj/core/internal/Strings.java
@@ -528,8 +528,7 @@ private boolean stringContains(CharSequence actual, CharSeque... | diff --git a/src/test/java/org/assertj/core/internal/strings/Strings_assertContainsIgnoringCase_Test.java b/src/test/java/org/assertj/core/internal/strings/Strings_assertContainsIgnoringCase_Test.java
--- a/src/test/java/org/assertj/core/internal/strings/Strings_assertContainsIgnoringCase_Test.java
+++ b/src/test/java/... | assertContainsIgnoringCase fails to compare i and I in tr_TR locale
See `org.assertj.core.internal.Strings#assertContainsIgnoringCase`
https://github.com/assertj/assertj-core/blob/9051a958e6ab0a750bb243060aef57001ab97e6e/src/main/java/org/assertj/core/internal/Strings.java#L528-L531
I would suggest adding https:/... | 2022-06-25T14:10:08Z | 3.23 | |
assertj/assertj | 2,549 | assertj__assertj-2549 | [
"2547"
] | 92548d8916425787c8a60e6dea638b285825ca12 | diff --git a/src/main/java/org/assertj/core/internal/Maps.java b/src/main/java/org/assertj/core/internal/Maps.java
--- a/src/main/java/org/assertj/core/internal/Maps.java
+++ b/src/main/java/org/assertj/core/internal/Maps.java
@@ -419,6 +419,8 @@ private static <K> Set<K> getNotExpectedKeys(Map<K, ?> actual, K[] expect... | diff --git a/src/test/java/org/assertj/core/internal/maps/Maps_assertContainsOnlyKeys_Test.java b/src/test/java/org/assertj/core/internal/maps/Maps_assertContainsOnlyKeys_Test.java
--- a/src/test/java/org/assertj/core/internal/maps/Maps_assertContainsOnlyKeys_Test.java
+++ b/src/test/java/org/assertj/core/internal/maps... | Regression in `AbstractMapAssert#containsOnlyKeys` with Spring's `MultiValueMapAdapter`
#### Summary
We saw this when updating from AssertJ 3.19.0 to 3.20.0. It appears that `AbstractMapAssert#containsOnlyKeys` is mutating the map that we're asserting on, which leads to test failures in our case. This is happening on ... | With a quick look, the only option seems to be performing a check of the fully-qualified class name: if it's `org.springframework.util.MultiValueMapAdapter`, we don't try to clone the map but copy it directly. | 2022-03-30T20:25:27Z | 3.22 |
assertj/assertj | 2,410 | assertj__assertj-2410 | [
"2397"
] | 471e8a80347dc6e759e58a5ead7f700532e00dc6 | diff --git a/src/main/java/org/assertj/core/api/Assertions.java b/src/main/java/org/assertj/core/api/Assertions.java
--- a/src/main/java/org/assertj/core/api/Assertions.java
+++ b/src/main/java/org/assertj/core/api/Assertions.java
@@ -1160,7 +1160,7 @@ public static <T extends Throwable> AbstractThrowableAssert<?, T> a... | diff --git a/src/test/java/org/assertj/core/api/Assertions_catchException_Test.java b/src/test/java/org/assertj/core/api/Assertions_catchException_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/Assertions_catchException_Test.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed under the Apache ... | `catchThrowableOfType` enriched alternatives
#### Summary
Similarly to the enriched alternatives of [`assertThatExceptionOfType`](https://assertj.github.io/doc/#assertj-core-exception-assertions-assertThatExceptionOfType), we could introduce enriched versions of `catchThrowableOfType`.
#### Example
```java
Null... | I would like to work on this one as my first contribution
Sure, thanks @Spacca! | 2021-11-14T09:30:05Z | 3.21 |
assertj/assertj | 2,297 | assertj__assertj-2297 | [
"731"
] | fe1c4630da8a38e378a6baa703191d9860e3df2d | diff --git a/src/main/java/org/assertj/core/api/AbstractAssert.java b/src/main/java/org/assertj/core/api/AbstractAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractAssert.java
@@ -817,6 +817,37 @@ public SELF matches(Predicate<? super ACTUAL> predic... | diff --git a/src/test/java/org/assertj/core/api/ThrowingConsumer_accept_Test.java b/src/test/java/org/assertj/core/api/ThrowingConsumer_accept_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/ThrowingConsumer_accept_Test.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed under the Apache Licens... | Add satisfies with checked exceptions consumer.
Hello,
Currently it is not possible to write code like that:
``` java
assertThat(item).satisfies(i -> {
assertThat(i.getContent()).isEqualTo("data"); // i.getContent() throws IOException
});
```
Would it be possible to add satisfies method which can handle consumer... | I believe it is not possible at the AssertJ level, you would need to use something like `LambdaExceptionUtil` as described in http://stackoverflow.com/questions/27644361/how-can-i-throw-checked-exceptions-from-inside-java-8-streams.
First answer in link that you posted suggested that this is in fact `java.util.functio... | 2021-07-26T10:30:08Z | 3.2 |
assertj/assertj | 2,247 | assertj__assertj-2247 | [
"2236"
] | e8e221dafb69c88b64bddb8accd497e26c1635ee | diff --git a/src/main/java/org/assertj/core/api/AbstractFileAssert.java b/src/main/java/org/assertj/core/api/AbstractFileAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractFileAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractFileAssert.java
@@ -19,6 +19,7 @@
import java.io.UncheckedIOException;
... | diff --git a/src/test/java/org/assertj/core/api/file/FileAssert_hasFileName_Test.java b/src/test/java/org/assertj/core/api/file/FileAssert_hasFileName_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/file/FileAssert_hasFileName_Test.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed under the A... | Add `hasFileName` as an alias of `hasName` for `File` assertions
#### Example
```java
assertThat(new File("file.txt")).hasFileName("file.txt");
```
Related to #2205.
| Hey, Can I pick this up?
Sure @ShivakumarSwamy, go for it! | 2021-06-05T17:57:43Z | 3.2 |
assertj/assertj | 2,200 | assertj__assertj-2200 | [
"2199"
] | 81ed66f4710138d30e4a4b5ab83ef2989e7f39dd | diff --git a/src/main/java/org/assertj/core/api/Descriptable.java b/src/main/java/org/assertj/core/api/Descriptable.java
--- a/src/main/java/org/assertj/core/api/Descriptable.java
+++ b/src/main/java/org/assertj/core/api/Descriptable.java
@@ -46,7 +46,7 @@ public interface Descriptable<SELF> {
* } catch (AssertionE... | diff --git a/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_isInstanceOfSatisfying_Test.java b/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_isInstanceOfSatisfying_Test.java
--- a/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_isInstanceOfSatisfying_Test.java
+++ b/src/test/java/... | Remove space in default error message for ShouldBeEqual to help IntelliJ diff detection
Referencing this StackOverflow ticket: https://stackoverflow.com/questions/10934743/formatting-output-so-that-intellij-idea-shows-diffs-for-two-texts
It seems that IntelliJ expects assertion errors to be in this format in order t... | We did that to get values aligned but I guess we can remove that space for intellij idea
```
expected:
but was :
```
@rpeng could we do that instead?:
```
expected:
but was:
```
@scordio did you have that issue? can you try that second proposal to see if it renders properly?
Just tried it out with the seco... | 2021-05-06T02:12:01Z | 3.19 |
assertj/assertj | 2,193 | assertj__assertj-2193 | [
"2103"
] | 5dc550b80937ab3ff41645de7036e97fa0097f38 | diff --git a/src/main/java/org/assertj/core/condition/MappedCondition.java b/src/main/java/org/assertj/core/condition/MappedCondition.java
new file mode 100644
--- /dev/null
+++ b/src/main/java/org/assertj/core/condition/MappedCondition.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the ... | diff --git a/src/test/java/org/assertj/core/condition/MappedConditionTest.java b/src/test/java/org/assertj/core/condition/MappedConditionTest.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/condition/MappedConditionTest.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed under the Apache License, Versi... | Mapped-Condition
**Mapped**: A Condition that describes the way of Mapping to an nested Condition.
| Is there anything i can to to get this pr into the next release?
I'll try have a look, it is not so clear what problem you are trying to solve, an example would be welcome
Thank you,
the main goal is to have a Container-Condition that does a mapping and then usees nested Conditions to test the mapped actual value.
... | 2021-04-30T11:29:02Z | 3.19 |
assertj/assertj | 2,042 | assertj__assertj-2042 | [
"1948"
] | 9bf0d577a30e2bd7f1abe6ba1259b9f7404443a8 | diff --git a/src/main/java/org/assertj/core/api/AbstractLongArrayAssert.java b/src/main/java/org/assertj/core/api/AbstractLongArrayAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractLongArrayAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractLongArrayAssert.java
@@ -12,6 +12,10 @@
*/
package org.... | diff --git a/src/test/java/org/assertj/core/api/longarray/LongArrayAssert_containsAnyOf_with_Long_array_Test.java b/src/test/java/org/assertj/core/api/longarray/LongArrayAssert_containsAnyOf_with_Long_array_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/longarray/LongArrayAssert_c... | Comparing of Boxed vs. Unboxed Array broken
#### Summary
Before PR #1767 (specifically commit [76762a3664b3af2101d580355a05c6f0b3aa46cc](../commit/76762a3664b3af2101d580355a05c6f0b3aa46cc)) it was possible to compare a boxed with an unboxed array.
This was because org.assertj.core.util.areEqualArrays was comparing en... | My initial feeling is that the old behavior was violating the language design, which [supports boxing/unboxing for primitive types](https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.1.7) but not for the corresponding arrays.
Also, IntelliJ fires an [`assertEquals`() between objects of inconvertible ... | 2020-11-22T23:34:41Z | 3.18 |
assertj/assertj | 1,983 | assertj__assertj-1983 | [
"1961"
] | 8a9712c105031456f046471c81029bbf5baeee25 | diff --git a/src/main/java/org/assertj/core/api/Assumptions.java b/src/main/java/org/assertj/core/api/Assumptions.java
--- a/src/main/java/org/assertj/core/api/Assumptions.java
+++ b/src/main/java/org/assertj/core/api/Assumptions.java
@@ -1293,16 +1293,16 @@ protected static <ASSERTION> Class<? extends ASSERTION> gener... | diff --git a/src/test/java/org/assertj/core/api/assumptions/Assumptions_assumeThat_Atomics_Test.java b/src/test/java/org/assertj/core/api/assumptions/Assumptions_assumeThat_Atomics_Test.java
--- a/src/test/java/org/assertj/core/api/assumptions/Assumptions_assumeThat_Atomics_Test.java
+++ b/src/test/java/org/assertj/cor... | Assumptions.assumeThat incompatible with TestNG 7.1.1+
See https://github.com/cbeust/testng/issues/2352
| Thanks for reporting the issue @C-Otto.
We could increase the precedence of `org.testng.SkipException` over `org.junit.AssumptionViolatedException`, but I would first wait for a feedback on the TestNG issue you opened.
cbeust/testng#2358 should fix this issue. | 2020-08-27T19:24:36Z | 3.17 |
assertj/assertj | 1,890 | assertj__assertj-1890 | [
"1887"
] | 50de3245ac017de6544f225777ee3bf058fce9a6 | diff --git a/src/main/java/org/assertj/core/api/AbstractUrlAssert.java b/src/main/java/org/assertj/core/api/AbstractUrlAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractUrlAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractUrlAssert.java
@@ -419,7 +419,7 @@ public SELF hasNoParameter(String name, S... | diff --git a/src/test/java/org/assertj/core/api/uri/UriAssert_hasNoPath_Test.java b/src/test/java/org/assertj/core/api/uri/UriAssert_hasNoPath_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/uri/UriAssert_hasNoPath_Test.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed under the Apache Licens... | Some APIs have no test
#### Summary
When I run the coverage test, I find:
- in `AbstractUrlAssert`: `hasNoPath()` and `hasNoParameters()` have no test.
- in `AbstractUriAssert`:`hasNoPath()` has no test.
Actually, Intellij IDEA tells me that they are never used.
I am happy to raise this as a PR if this issue i... | Yes please, improving test coverage is always good!
This gap is also mentioned in the Sonar report: https://sonarcloud.io/component_measures?id=joel-costigliola_assertj-core&metric=new_lines_to_cover&view=list
OK, thanks! I think I may have to wait for my last PR being merged.
When I write tests for `haveNoPath()`,... | 2020-05-29T07:34:58Z | 3.16 |
assertj/assertj | 1,769 | assertj__assertj-1769 | [
"1768"
] | 089bbe43e39a0933818d98a698eea5d49aeeaedf | diff --git a/src/main/java/org/assertj/core/error/ClassModifierShouldBe.java b/src/main/java/org/assertj/core/error/ClassModifierShouldBe.java
--- a/src/main/java/org/assertj/core/error/ClassModifierShouldBe.java
+++ b/src/main/java/org/assertj/core/error/ClassModifierShouldBe.java
@@ -12,12 +12,13 @@
*/
package org... | diff --git a/src/test/java/org/assertj/core/error/ClassModifierShouldBe_create_Test.java b/src/test/java/org/assertj/core/error/ClassModifierShouldBe_create_Test.java
--- a/src/test/java/org/assertj/core/error/ClassModifierShouldBe_create_Test.java
+++ b/src/test/java/org/assertj/core/error/ClassModifierShouldBe_create... | Trailing space in the modifiers list for ClassModifierShouldBe
#### Summary
When a class is only `package-private` and a `ClassModifierShouldBe` message is created, the list of modifiers in the failure message contains a trailing space right after the `package-private` value.
#### Example
Given:
```java
clas... | 2020-01-30T00:50:43Z | 3.15 | |
assertj/assertj | 1,743 | assertj__assertj-1743 | [
"1512"
] | da67a1395c10f02bd80ccd5b642239fad6ae089e | diff --git a/src/main/java/org/assertj/core/api/AbstractClassAssert.java b/src/main/java/org/assertj/core/api/AbstractClassAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractClassAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractClassAssert.java
@@ -349,6 +349,45 @@ public SELF hasAnnotation(Class<... | diff --git a/src/test/java/org/assertj/core/api/classes/ClassAssert_hasSuperclass_Test.java b/src/test/java/org/assertj/core/api/classes/ClassAssert_hasSuperclass_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/classes/ClassAssert_hasSuperclass_Test.java
@@ -0,0 +1,39 @@
+/*
+ * Li... | Add hasSuperclass(Class<?>) to AbstractClassAssert
#### Summary
Sometimes I feel the lack of `isNotAssignableFrom()` in `AbstractClassAssert`.
Recently I needed a defensive test to enforce an exception class staying "checked" (i.e., not inheriting from `RuntimeException`). To do that, I created a custom condition:
... | I'm ok with `isNotAssignableFrom` as the opposite of `isAssignableFrom`.
Having said that, I have always found the (JDK) `isAssignableFrom` method to be highly unclear, I often find myself wondering which class should inherit from the other one.
It would be great to find a better name for the `isAssignableFrom` a... | 2020-01-02T08:43:16Z | 3.14 |
assertj/assertj | 1,629 | assertj__assertj-1629 | [
"1628"
] | 9f7ab5b7f2ee2b015b5268a323b4ac69bca5240a | diff --git a/src/main/java/org/assertj/core/api/SoftProxies.java b/src/main/java/org/assertj/core/api/SoftProxies.java
--- a/src/main/java/org/assertj/core/api/SoftProxies.java
+++ b/src/main/java/org/assertj/core/api/SoftProxies.java
@@ -54,6 +54,7 @@ class SoftProxies {
... | diff --git a/src/test/java/org/assertj/core/api/SoftAssertionsTest.java b/src/test/java/org/assertj/core/api/SoftAssertionsTest.java
--- a/src/test/java/org/assertj/core/api/SoftAssertionsTest.java
+++ b/src/test/java/org/assertj/core/api/SoftAssertionsTest.java
@@ -823,24 +823,18 @@ public void should_work_with_predic... | AbstractOptionalAssert#get() is not correctly proxied with SoftAssertions
#### Summary
AbstractOptionalAssert#get() is not listed under `METHODS_CHANGING_THE_OBJECT_UNDER_TEST` of `SoftProxies`.
#### Example
```java
SoftAssertions softly = new SoftAssertions();
Optional<String> optional = Optional.of("Yoda");
... | Good catch! | 2019-10-06T08:57:07Z | 3.13 |
assertj/assertj | 1,332 | assertj__assertj-1332 | [
"1331"
] | 1747c1e5df371cef2750dc4321eaf391670e294c | diff --git a/src/main/java/org/assertj/core/internal/Strings.java b/src/main/java/org/assertj/core/internal/Strings.java
--- a/src/main/java/org/assertj/core/internal/Strings.java
+++ b/src/main/java/org/assertj/core/internal/Strings.java
@@ -550,7 +550,7 @@ private void checkCharSequenceIsNotNull(CharSequence sequence... | diff --git a/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java b/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java
--- a/src/test/java/org/assertj/core/internal/strings/Strings_assertEqualsIgnoringWhitespace_Test.java
+++ b/sr... | Throw AssertionFailedError instead of AssertionError in non-strict string assertions
#### Summary
Throwing AssertionFailedError from opentest4j facilitates test failure analysis in IDE providing handy "diff" view.
AssertJ already uses AssertionFailedError (if available on the classpath) but not in non-strict string a... | 2018-09-26T23:58:31Z | 3.11 | |
assertj/assertj | 1,568 | assertj__assertj-1568 | [
"1567"
] | b770d0c9c26606e84acbe3836320209805db2186 | diff --git a/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java b/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java
--- a/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java
+++ b/src/main/java/org/assertj/core/api/InstanceOfAssertFactories.java
@@ -204,15 +204,25 @@ static ... | diff --git a/src/test/java/org/assertj/core/api/InstanceOfAssertFactoriesTest.java b/src/test/java/org/assertj/core/api/InstanceOfAssertFactoriesTest.java
--- a/src/test/java/org/assertj/core/api/InstanceOfAssertFactoriesTest.java
+++ b/src/test/java/org/assertj/core/api/InstanceOfAssertFactoriesTest.java
@@ -82,8 +82,... | import static org.assertj.core.api.Assertions.* clashes with URI (java.net.URI)
#### Summary
Statically importing AssertJ assertions imports fields from `InstanceOfAssertFactories`. The `URI` field shadows `java.net.URI` and requires fully qualified naming when using `java.net.URI`.
There's a similar issue for `... | Thanks for reporting this @mp911de.
Thinking out loud, we might simply rename the factories to disambiguate this.
That would help. URI and URL are the only two types where factory constants are clashing. All other types use some sort of different letter casing.
Maybe this should have been part of the 3.13.1 release... | 2019-07-29T22:53:20Z | 3.13 |
assertj/assertj | 1,511 | assertj__assertj-1511 | [
"1506"
] | ce439bde862f94cb3bfd327406f3c943f375c63e | diff --git a/src/main/java/org/assertj/core/api/AbstractDateAssert.java b/src/main/java/org/assertj/core/api/AbstractDateAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractDateAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractDateAssert.java
@@ -711,7 +711,7 @@ public SELF isBeforeOrEqualsTo(Date o... | diff --git a/src/test/java/org/assertj/core/api/date/DateAssert_isAfterOrEqualTo_Test.java b/src/test/java/org/assertj/core/api/date/DateAssert_isAfterOrEqualTo_Test.java
--- a/src/test/java/org/assertj/core/api/date/DateAssert_isAfterOrEqualTo_Test.java
+++ b/src/test/java/org/assertj/core/api/date/DateAssert_isAfterO... | Typo in AbstractDateAssert#isBeforeOrEqualsTo method name?
#### Summary
`AbstractDateAssert#isBeforeOrEqualsTo` has a trailing 's' in 'Equals' and it looks like a typo compared to java 8 time assertions (same for `AbstractDateAssert#isAfterOrEqualsTo`). It is just a style issue and fixing it would be a backwards incom... | Yeah, good catch :man_facepalming: .
The way to go is is deprecate `isBeforeOrEqualsTo` / `isAfterOrEqualsTo` and add `isBeforeOrEqualTo` / `isAfterOrEqualTo`. For the other typos a rename refactoring will do. | 2019-05-22T05:05:31Z | 3.12 |
assertj/assertj | 1,243 | assertj__assertj-1243 | [
"1232"
] | 17d405970d0c67b02e4d2cf27761b7351f8d7af7 | diff --git a/src/main/java/org/assertj/core/api/Assertions.java b/src/main/java/org/assertj/core/api/Assertions.java
--- a/src/main/java/org/assertj/core/api/Assertions.java
+++ b/src/main/java/org/assertj/core/api/Assertions.java
@@ -2565,6 +2565,29 @@ public static <T> T assertThat(final AssertProvider<T> component) ... | diff --git a/src/test/java/org/assertj/core/api/Assertions_assertThat_with_StringBuffer_Test.java b/src/test/java/org/assertj/core/api/Assertions_assertThat_with_StringBuffer_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/Assertions_assertThat_with_StringBuffer_Test.java
@@ -0,0 +... | Java 11 EA Build: Compile Errors: ambiguous reference both <T>assertThat(T) and method assertThat(java.lang.CharSequence) match
Just for your information.
When running `mvn clean test` using:
```
java version "11-ea" 2018-09-25
Java(TM) SE Runtime Environment 18.9 (build 11-ea+10)
Java HotSpot(TM) 64-Bit Serve... | Any idea what the underlying cause is ?
For info, same error in my environment.
**Java version**
```
~/prog/assertj/assertj-core-3.x ∙ java -version
openjdk version "11-ea" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11-ea+13)
OpenJDK 64-Bit Server VM 18.9 (build 11-ea+13, mixed mode)
```
**Maven ... | 2018-05-21T15:08:28Z | 3.1 |
assertj/assertj | 1,204 | assertj__assertj-1204 | [
"1145"
] | 99b8065754ee41dfe29e626b4f66fd1d1ba8aec3 | diff --git a/src/main/java/org/assertj/core/error/ShouldBeEqualByComparingFieldByFieldRecursively.java b/src/main/java/org/assertj/core/error/ShouldBeEqualByComparingFieldByFieldRecursively.java
--- a/src/main/java/org/assertj/core/error/ShouldBeEqualByComparingFieldByFieldRecursively.java
+++ b/src/main/java/org/asser... | diff --git a/src/test/java/org/assertj/core/error/ShouldBeEqualByComparingFieldByFieldRecursively_create_Test.java b/src/test/java/org/assertj/core/error/ShouldBeEqualByComparingFieldByFieldRecursively_create_Test.java
--- a/src/test/java/org/assertj/core/error/ShouldBeEqualByComparingFieldByFieldRecursively_create_Tes... | `isEqualToComparingFieldByFieldRecursively` throws NullPointerException while comparing null values
#### Summary
If a nested field is null while comparing equality for two objects with `isEqualToComparingFieldByFieldRecursively` a NullPointerException is thrown.
### Stacktrace
```
Exception in thread "main" j... | Thanks for reporting this !
This is regression in version `2.9.0/3.9.0` introduced by https://github.com/joel-costigliola/assertj-core/commit/fb9f9522f7abe2d863af6aa760ec7e8162009f49
@hwielenberg As a workaround you can use `3.8.0`
I could write the Bugfix if you want.
Should be straightforward.
Contributions w... | 2018-03-13T19:54:11Z | 2.9 |
assertj/assertj | 1,184 | assertj__assertj-1184 | [
"1175"
] | 48cbf8e2fbb7185492aba6e4fa2dfdc659139a45 | diff --git a/src/main/java/org/assertj/core/api/AbstractFileAssert.java b/src/main/java/org/assertj/core/api/AbstractFileAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractFileAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractFileAssert.java
@@ -16,8 +16,8 @@
import static org.assertj.core.util.Pr... | diff --git a/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java b/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java
--- a/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java
+++ b/src/test/java/org/assertj/core/api/WithAssertions_delegation_Test.java
@@ -17,6 ... | Replace RuntimeIOException with UncheckedIOException?
Should we replace the AssertJ specific `RuntimeIOException` with `UncheckedIOException` which was added in Java 8?
| I can work on this 👍
@joel-costigliola what should we do with the missing constructors in UncheckedIOException?
e.g. RuntimeIOException(String message)
UncheckedIOException Constructors:
UncheckedIOException(IOException cause)
UncheckedIOException(String message, IOException cause)
can't we use `UncheckedI... | 2018-02-18T12:17:19Z | 3.9 |
assertj/assertj | 1,134 | assertj__assertj-1134 | [
"1128"
] | bd359b62a681cbf77827d906644093c6c8824d5a | diff --git a/src/main/java/org/assertj/core/api/AbstractAssert.java b/src/main/java/org/assertj/core/api/AbstractAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractAssert.java
@@ -50,6 +50,9 @@
*/
public abstract class AbstractAssert<SELF extends... | diff --git a/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_equal_hashCode_Test.java b/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_equal_hashCode_Test.java
--- a/src/test/java/org/assertj/core/api/abstract_/AbstractAssert_equal_hashCode_Test.java
+++ b/src/test/java/org/assertj/core/api/abs... | Must AbstractAssert#equals throw UnsupportedOperationException
#### Summary
@joel-costigliola Is it necessary for the `AbstractAssert#equals` to throw the `UnsupportedOperationException`?
This is against the contract of `Object#equals` and brakes other libraries which are not handling this. I know that it should be ... | This is done to avoid misusing the API like that:
```java
// BAD
assertThat(actual).equals(expected);
// GOOD
assertThat(actual).isEqualTo(expected);
```
`*Assert` are not meant to be compared, what is the concrete use case for that (I don't know what coroutines are) ? is it Kotlin specific ?
Ok, I understan... | 2017-12-19T06:53:29Z | 3.8 |
assertj/assertj | 1,014 | assertj__assertj-1014 | [
"1009",
"1009"
] | 92c396e52844a283a07b8ecf81ca71be757d3631 | diff --git a/src/main/java/org/assertj/core/api/AbstractIterableAssert.java b/src/main/java/org/assertj/core/api/AbstractIterableAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractIterableAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractIterableAssert.java
@@ -222,6 +222,14 @@ public SELF contains... | diff --git a/src/test/java/org/assertj/core/api/atomic/referencearray/AtomicReferenceArrayAssert_containsExactlyInAnyOrderElementsOf_Test.java b/src/test/java/org/assertj/core/api/atomic/referencearray/AtomicReferenceArrayAssert_containsExactlyInAnyOrderElementsOf_Test.java
new file mode 100644
--- /dev/null
+++ b/src/... | containsExactlyInAnyOrderElementsOf
#### Summary
Variation of `containsExactlyInAnyOrder` with an `Iterable` parameter.
The assertion is named `containsExactlyInAnyOrderElementsOf` for consistency with the API (ex `containsExactlyElementsOf`).
#### Example
```java
// an Iterable is used in the example but it... | 2017-06-20T17:33:19Z | 2.8 | |
assertj/assertj | 813 | assertj__assertj-813 | [
"812"
] | d517f7761f4f7a13e86aa04c3f1aa8584fef881a | diff --git a/src/main/java/org/assertj/core/error/OptionalShouldContainInstanceOf.java b/src/main/java/org/assertj/core/error/OptionalShouldContainInstanceOf.java
--- a/src/main/java/org/assertj/core/error/OptionalShouldContainInstanceOf.java
+++ b/src/main/java/org/assertj/core/error/OptionalShouldContainInstanceOf.ja... | diff --git a/src/test/java/org/assertj/core/error/OptionalShouldContainInstanceOf_create_Test.java b/src/test/java/org/assertj/core/error/OptionalShouldContainInstanceOf_create_Test.java
--- a/src/test/java/org/assertj/core/error/OptionalShouldContainInstanceOf_create_Test.java
+++ b/src/test/java/org/assertj/core/erro... | Improve error message for "optional.containsInstanceOf(clazz)"
#### Summary
The error message for OptionalAssert.containsInstanceOf() is less descriptive than the similar message for AbstractAssert.isInstanceOf. Pull request is in the works.
#### Example
Before change:
```java
Expecting Optional to contain... | 2016-11-28T11:27:01Z | 3.6 | |
assertj/assertj | 656 | assertj__assertj-656 | [
"655"
] | 319d0ce078adfd83575c15b21b7916470fe46d10 | diff --git a/src/main/java/org/assertj/core/api/IterableAssert.java b/src/main/java/org/assertj/core/api/IterableAssert.java
--- a/src/main/java/org/assertj/core/api/IterableAssert.java
+++ b/src/main/java/org/assertj/core/api/IterableAssert.java
@@ -120,6 +120,24 @@ public IterableAssert<T> isNotExactlyInstanceOf(Clas... | diff --git a/src/test/java/org/assertj/core/api/Assertions_assertThat_with_Iterator_Test.java b/src/test/java/org/assertj/core/api/Assertions_assertThat_with_Iterator_Test.java
--- a/src/test/java/org/assertj/core/api/Assertions_assertThat_with_Iterator_Test.java
+++ b/src/test/java/org/assertj/core/api/Assertions_asse... | IterableAssert should override isSameAs and isNotSameAs to unroll the actual instance.
#### Summary
IterableAssert does not override the methods to unroll the actual instance.
#### Real life use case or example
```
@Test
public void testIterator() {
Iterator<String> iterator = new ArrayList<String>().iterator();... | 2016-05-02T13:04:13Z | 3.4 | |
assertj/assertj | 54 | assertj__assertj-54 | [
"26"
] | 0c554a37b677ec6fe2744d683c4f235d090dbb29 | diff --git a/src/main/java/org/assertj/core/api/AbstractIterableAssert.java b/src/main/java/org/assertj/core/api/AbstractIterableAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractIterableAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractIterableAssert.java
@@ -126,12 +126,37 @@ public S containsSe... | diff --git a/src/test/java/org/assertj/core/api/iterable/IterableAssert_doesNotContainAnyElementsOf_Test.java b/src/test/java/org/assertj/core/api/iterable/IterableAssert_doesNotContainAnyElementsOf_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/iterable/IterableAssert_doesNotCont... | New Iterable assertion : doesNotContainAnyElementsOf(Iterable)
Exact signature :
``` java
public S doesNotContainAnyElementsOf(Iterable<? extends T> iterable)
```
| What the difference with the function :
``` java
/**
* Verifies that the actual group does not contain the given values.
*
* @param values the given values.
* @return {@code this} assertion object.
* @throws NullPointerException if the given argument is {@code null}.
* @throws IllegalArgumentExcep... | 2013-05-06T23:25:52Z | 1.1 |
assertj/assertj | 73 | assertj__assertj-73 | [
"18"
] | 57bd41463aaa76a86e47090a91ca684e9abb90bc | diff --git a/src/main/java/org/assertj/core/api/BooleanArrayAssert.java b/src/main/java/org/assertj/core/api/BooleanArrayAssert.java
--- a/src/main/java/org/assertj/core/api/BooleanArrayAssert.java
+++ b/src/main/java/org/assertj/core/api/BooleanArrayAssert.java
@@ -239,4 +239,32 @@ public final BooleanArrayAssert usin... | diff --git a/src/test/java/org/assertj/core/api/booleanarray/BooleanArrayAssert_containsExactly_Test.java b/src/test/java/org/assertj/core/api/booleanarray/BooleanArrayAssert_containsExactly_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/booleanarray/BooleanArrayAssert_containsExa... | XXXArrayAssert : add containsExactly(XXX... elements)
it would be handy to have
``` java
int[] myArray = ...
assertThat(myArray).containsExactly(1,4,7);
```
| 2013-05-19T21:29:51Z | 1.2 | |
assertj/assertj | 169 | assertj__assertj-169 | [
"151",
"151"
] | eee3ad92ce3ba261cd99435254b0c8574711f5b8 | diff --git a/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java b/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractCharSequenceAssert.java
@@ -143,6 +143,31 @@ publ... | diff --git a/src/test/java/org/assertj/core/api/charsequence/CharSequenceAssert_hasSameSizeAs_with_CharSequence_Test.java b/src/test/java/org/assertj/core/api/charsequence/CharSequenceAssert_hasSameSizeAs_with_CharSequence_Test.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/charsequenc... | String .hasSameSizeAs(...) should accept other String
We should extends this api to Strings for code like this
```
Assertions.assertThat("sss").hasSameSizeAs("dd");
```
String .hasSameSizeAs(...) should accept other String
We should extends this api to Strings for code like this
```
Assertions.assertThat("sss").hasS... | I would like to contribute, can I?
Yes that would be great !
Follow the [contributing guide](https://github.com/joel-costigliola/assertj-core/blob/master/CONTRIBUTING.md) and don't hesitate if you have questions ...
Thanks !
Probably this API should accept `CharSequence` interface to allow to pass not only strings... | 2014-02-02T15:44:15Z | 1.5 |
assertj/assertj | 225 | assertj__assertj-225 | [
"217"
] | b7c1bc2dc62e4b419f1dd6d896395c7b8d204232 | diff --git a/src/main/java/org/assertj/core/internal/Diff.java b/src/main/java/org/assertj/core/internal/Diff.java
--- a/src/main/java/org/assertj/core/internal/Diff.java
+++ b/src/main/java/org/assertj/core/internal/Diff.java
@@ -109,7 +109,7 @@ private BufferedReader readerFor(String string) {
private List<Strin... | diff --git a/src/test/java/org/assertj/core/api/SoftAssertionsTest.java b/src/test/java/org/assertj/core/api/SoftAssertionsTest.java
--- a/src/test/java/org/assertj/core/api/SoftAssertionsTest.java
+++ b/src/test/java/org/assertj/core/api/SoftAssertionsTest.java
@@ -168,7 +168,7 @@ public String toString() {
a... | Line count should start at 1 instead of 0 when comparing file content
In the example below, the first line is not correct, the error should mention line 1 instead of line 0.
```
Caused by: java.lang.AssertionError:
File:
</home/joel/prog/assertj/assertj-assertions-generator/target/org/assertj/assertions/generator/da... | 2014-08-08T22:09:38Z | 1.6 | |
assertj/assertj | 101 | assertj__assertj-101 | [
"100"
] | 6fea2219f1917fa5ce6cb121bb7791bab56c3ab9 | diff --git a/src/main/java/org/assertj/core/api/AbstractAssert.java b/src/main/java/org/assertj/core/api/AbstractAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractAssert.java
@@ -80,7 +80,7 @@ protected WritableAssertionInfo getWritableAssertionInf... | diff --git a/src/test/java/org/assertj/core/description/TextDescription_toString_Test.java b/src/test/java/org/assertj/core/description/TextDescription_toString_Test.java
--- a/src/test/java/org/assertj/core/description/TextDescription_toString_Test.java
+++ b/src/test/java/org/assertj/core/description/TextDescription_... | Allow String.format for test description
Instead of:
``` java
assertThat(itemCount).as("Check " + item + " count").isEqualTo(5);
```
We would write:
``` java
assertThat(itemCount).as("Check %s count", item).isEqualTo(5);
```
| 2013-08-20T23:19:06Z | 1.3 | |
assertj/assertj | 120 | assertj__assertj-120 | [
"118"
] | 8e140203418fdb7b01cacd12bd2a76cf33047171 | diff --git a/src/main/java/org/assertj/core/api/AbstractDateAssert.java b/src/main/java/org/assertj/core/api/AbstractDateAssert.java
--- a/src/main/java/org/assertj/core/api/AbstractDateAssert.java
+++ b/src/main/java/org/assertj/core/api/AbstractDateAssert.java
@@ -16,7 +16,7 @@
/**
* Base class for all implement... | diff --git a/src/test/java/org/assertj/core/api/date/DateAssert_isEqualToIgnoringHours.java b/src/test/java/org/assertj/core/api/date/DateAssert_isEqualToIgnoringHours.java
new file mode 100644
--- /dev/null
+++ b/src/test/java/org/assertj/core/api/date/DateAssert_isEqualToIgnoringHours.java
@@ -0,0 +1,45 @@
+/*
+ * Cr... | New date assertions comparing dates given a precision level.
For example, one can compare two dates up to minutes precision:
``` java
Date date1 = parseDatetime("2003-04-26T13:01:35");
Date date2 = parseDatetime("2003-04-26T13:02:00");
// OK : all dates fields are the same up to minutes excluded
assertThat(date1).is... | 2013-10-07T13:38:43Z | 1.4 | |
assertj/assertj | 613 | assertj__assertj-613 | [
"611"
] | 3118bf043099fba418bc908388afc0fbd25cf772 | diff --git a/src/main/java/org/assertj/core/internal/Longs.java b/src/main/java/org/assertj/core/internal/Longs.java
--- a/src/main/java/org/assertj/core/internal/Longs.java
+++ b/src/main/java/org/assertj/core/internal/Longs.java
@@ -73,7 +73,7 @@ public void assertIsCloseToPercentage(AssertionInfo info, Long actual, ... | diff --git a/src/test/java/org/assertj/core/internal/bigdecimals/BigDecimals_assertIsCloseToPercentage_Test.java b/src/test/java/org/assertj/core/internal/bigdecimals/BigDecimals_assertIsCloseToPercentage_Test.java
--- a/src/test/java/org/assertj/core/internal/bigdecimals/BigDecimals_assertIsCloseToPercentage_Test.java... | Assert "isCloseTo(double expected, Percentage p)" doesn't work for negative expected values
I have two tests whether an actual value is within a given percentage of the expected value.
The test for a positive expected value works without problems.
The test for a negative expected value throws `IllegalArgumentException... | True :crying_cat_face:
We screwed up, the computed offset is negative, we should have used an absolute values.
Thanks for reporting this. will be fixed in 2.4.0/3.4.0
| 2016-02-06T11:44:56Z | 2.3 |
nodejs/undici | 4,178 | nodejs__undici-4178 | [
"4173"
] | 0daba937990d92f670b858216e4715ec9f92da44 | diff --git a/lib/interceptor/cache.js b/lib/interceptor/cache.js
--- a/lib/interceptor/cache.js
+++ b/lib/interceptor/cache.js
@@ -20,7 +20,12 @@ const { AbortError } = require('../core/errors.js')
*/
function needsRevalidation (result, cacheControlDirectives) {
if (cacheControlDirectives?.['no-cache']) {
- //... | diff --git a/test/interceptors/cache.js b/test/interceptors/cache.js
--- a/test/interceptors/cache.js
+++ b/test/interceptors/cache.js
@@ -128,6 +128,45 @@ describe('Cache Interceptor', () => {
}
})
+ test('revalidates reponses with no-cache directive, regardless of cacheByDefault', async () => {
+ let re... | Cache prioritises cacheByDefault/max-age over `no-cache` response directive
## Bug Description
When `cacheByDefault` is set, no revalidation occurs for a response which had the `no-cache` directive.
## Reproducible By
```js
const http = require('node:http');
const server = http.createServer((req, res) => {
consol... | If this is indeed a bug, something like this should fix it:
```js
--- a/lib/interceptor/cache.js
+++ b/lib/interceptor/cache.js
@@ -20,7 +20,12 @@ const { AbortError } = require('../core/errors.js')
*/
function needsRevalidation (result, cacheControlDirectives) {
if (cacheControlDirectives?.['no-cache']) {
- ... | 2025-04-23T05:33:43Z | 7.8 |
nodejs/undici | 4,131 | nodejs__undici-4131 | [
"3904"
] | 67adf4237ea78c00e9db931c6638366d661119a1 | diff --git a/lib/interceptor/cache.js b/lib/interceptor/cache.js
--- a/lib/interceptor/cache.js
+++ b/lib/interceptor/cache.js
@@ -233,7 +233,7 @@ function handleResult (
}
let headers = {
- ...normaliseHeaders(opts),
+ ...opts.headers,
'if-modified-since': new Date(result.cachedAt).toUTCSt... | diff --git a/test/issue-3904.js b/test/issue-3904.js
new file mode 100644
--- /dev/null
+++ b/test/issue-3904.js
@@ -0,0 +1,58 @@
+const { describe, test, after } = require('node:test')
+const assert = require('node:assert')
+const { createServer } = require('node:http')
+const { once } = require('node:events')
+const ... | Cache interceptor does not process capitalized `Cache-Control` header in request
## Bug Description
Cache interceptor does not process `Cache-Control: no-store` request header if header name is capitalized.
In code we can see that you look for lowercased header name only.
You should convert header names to low... | Can you add a reproduction? It's working correctly here.
```javascript
import { Agent, fetch, interceptors } from "undici";
const dispatcher = new Agent().compose( interceptors.cache() );
for ( let n = 0; n < 2; n++ ) {
const res = await fetch( "https://httpbingo.org/cache/60", {
dispatcher,
... | 2025-04-01T15:29:49Z | 7.6 |
nodejs/undici | 4,112 | nodejs__undici-4112 | [
"4103"
] | c584721dbc5fa6abdf36433b22c478635e1ccc99 | diff --git a/lib/interceptor/cache.js b/lib/interceptor/cache.js
--- a/lib/interceptor/cache.js
+++ b/lib/interceptor/cache.js
@@ -6,7 +6,7 @@ const util = require('../core/util')
const CacheHandler = require('../handler/cache-handler')
const MemoryCacheStore = require('../cache/memory-cache-store')
const CacheReval... | diff --git a/test/interceptors/cache.js b/test/interceptors/cache.js
--- a/test/interceptors/cache.js
+++ b/test/interceptors/cache.js
@@ -135,22 +135,30 @@ describe('Cache Interceptor', () => {
let requestsToOrigin = 0
let revalidationRequests = 0
+ let serverError
const server = createServer({ joi... | Cache can add duplicate if-none-match, if-modified-since & varied headers (case-sensitivity)
## Bug Description
The code at https://github.com/nodejs/undici/blob/e43d01552adf78e57211f188ad6ce0f0a0529ab7/lib/interceptor/cache.js#L235-L249 will overwrite lower-cased user-defined headers, but duplicate non-lower-cased he... | Thanks for the report!
>cache code consistently overwrites user-defined header values
I believe this should be the way to move forward, as these are handled by the interceptor itself and overwrite them can lead to undefined behaviour.
Would you like to send a PR to address that?
> Would you like to send a PR to add... | 2025-03-21T08:22:05Z | 7.5 |
nodejs/undici | 4,088 | nodejs__undici-4088 | [
"3895"
] | ef276d4a296b99f547ed563a11e74ae71bc84bc1 | diff --git a/lib/dispatcher/pool.js b/lib/dispatcher/pool.js
--- a/lib/dispatcher/pool.js
+++ b/lib/dispatcher/pool.js
@@ -70,6 +70,20 @@ class Pool extends PoolBase {
? { ...options.interceptors }
: undefined
this[kFactory] = factory
+
+ this.on('connectionError', (origin, targets, error) => {
+ ... | diff --git a/test/pool-connection-error-memory-leak.js b/test/pool-connection-error-memory-leak.js
new file mode 100644
--- /dev/null
+++ b/test/pool-connection-error-memory-leak.js
@@ -0,0 +1,158 @@
+'use strict'
+
+const { test } = require('node:test')
+const assert = require('node:assert')
+const { Pool } = require(... | fetch memory leak
## Bug Description
`undici.fetch()` continues to use more memory the more requests made
## Reproducible By
Run `npm add undici@7.0.0` to install undici and then run the following code:
```js
const { fetch } = require('undici');
async function main() {
for (var i = 0; i <= 5000; i++) {... | There is no leak. This is tested at https://github.com/nodejs/undici/blob/main/test/fetch/fire-and-forget.js.
What you are experiencing is V8 seeing that there is a lot of memory in the system and it’s being lazy in collecting it
@mcollina How long does it take to collect? 🤔
I noticed your test uses `node -... | 2025-03-11T23:42:43Z | 7.4 |
nodejs/undici | 3,977 | nodejs__undici-3977 | [
"3975"
] | ad7ac027ed6d0fca7414a0810dcf136cda35065e | diff --git a/lib/handler/retry-handler.js b/lib/handler/retry-handler.js
--- a/lib/handler/retry-handler.js
+++ b/lib/handler/retry-handler.js
@@ -133,7 +133,7 @@ class RetryHandler {
? Math.min(retryAfterHeader, maxTimeout)
: Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout)
- se... | diff --git a/test/fixtures/interceptors/retry-event-loop.js b/test/fixtures/interceptors/retry-event-loop.js
new file mode 100644
--- /dev/null
+++ b/test/fixtures/interceptors/retry-event-loop.js
@@ -0,0 +1,33 @@
+'use strict'
+
+const { createServer } = require('node:http')
+const { once } = require('node:events')
+c... | RetryAgent doesn't keep the event loop alive
## Bug Description
When using RetryAgent, Node exits while there are pending retries in flight.
## Reproducible By
I've been playing around in a brand new node project with only `unidici` installed and trying to run the following script. This is mostly copy/pasted from t... | Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
> Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
It's not obvious to me what's wrong, or I would have sent one already! From skimming the RetryA... | 2024-12-31T08:01:58Z | 7.2 |
nodejs/undici | 3,855 | nodejs__undici-3855 | [
"3848",
"3848"
] | 61ec3531a64ffeec953a990c11735ff09455de4e | diff --git a/lib/api/api-request.js b/lib/api/api-request.js
--- a/lib/api/api-request.js
+++ b/lib/api/api-request.js
@@ -73,7 +73,7 @@ class RequestHandler extends AsyncResource {
this.removeAbortListener = util.addAbortListener(this.signal, () => {
this.reason = this.signal.reason ?? new RequestA... | diff --git a/test/client-request.js b/test/client-request.js
--- a/test/client-request.js
+++ b/test/client-request.js
@@ -1252,3 +1252,39 @@ test('request post body DataView', async (t) => {
await t.completed
})
+
+test('#3736 - Aborted Response (without consuming body)', async (t) => {
+ const plan = tspl(t, {... | Uncaught exception thrown in way that can't be intercepted in userland
## Bug Description
We had a recent incident wherein a specific workload was able to cause Node.js to crash due to an uncaught exception.
We saw two distinct cases of uncaught exceptions:
```
Error: read ECONNRESET
at Pipe.onStreamRead... | This is indeed a bad bug. However it'd be __impossible__ to fix without a reproduction. Would you mind to send a PR?
Looks to me like the body is missing an error handler, e.g. through `consumeStreamUpToDelimiter`
> Looks to me like the body is missing an error handler, e.g. through `consumeStreamUpToDelimiter`
@ron... | 2024-11-20T17:57:44Z | 6.21 |
nodejs/undici | 3,941 | nodejs__undici-3941 | [
"3934"
] | dd7473c2e0818161d182eab9bf9d709227851870 | diff --git a/lib/handler/wrap-handler.js b/lib/handler/wrap-handler.js
--- a/lib/handler/wrap-handler.js
+++ b/lib/handler/wrap-handler.js
@@ -53,8 +53,7 @@ module.exports = class WrapHandler {
onRequestUpgrade (controller, statusCode, headers, socket) {
const rawHeaders = []
for (const [key, val] of Objec... | diff --git a/test/client-node-max-header-size.js b/test/client-node-max-header-size.js
--- a/test/client-node-max-header-size.js
+++ b/test/client-node-max-header-size.js
@@ -25,7 +25,7 @@ describe("Node.js' --max-http-header-size cli option", () => {
test("respect Node.js' --max-http-header-size", async (t) => {
... | v7 `RetryAgent` converts header with multiple entries (eg. set-cookie) to `\x00`
## Bug Description
After upgrading from `6.21.0` to `7.1.0` the response `set-cookie` header contains `\x00` instead of actual values.
Expected
```js
{
server: 'nginx',
date: 'Mon, 09 Dec 2024 07:11:11 GMT',
'content-typ... | Can you provide an
[Minimum Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) to support you better?
Unfortunately I'm unable to reproduce the issue locally. I tried `node:http` and `node:http2` as server and sending multiple `set-cookie` headers works in both cases.
In production ... | 2024-12-10T19:57:40Z | 7.1 |
nodejs/undici | 3,833 | nodejs__undici-3833 | [
"3829"
] | 28b10fa5f8bf84d0e286ca576d13f75c50faf7cb | diff --git a/lib/web/fetch/headers.js b/lib/web/fetch/headers.js
--- a/lib/web/fetch/headers.js
+++ b/lib/web/fetch/headers.js
@@ -451,7 +451,7 @@ class Headers {
// 2. If init is given, then fill this with init.
if (init !== undefined) {
- init = webidl.converters.HeadersInit(init, 'Headers contructor... | diff --git a/test/fetch/headers.js b/test/fetch/headers.js
--- a/test/fetch/headers.js
+++ b/test/fetch/headers.js
@@ -26,7 +26,7 @@ test('Headers initialization', async (t) => {
throws(() => new Headers(['undici', 'fetch', 'fetch']), TypeError)
throws(
() => new Headers([0, 1, 2]),
- Type... | Error message for invalid headers could be improved
## Bug Description
I'm getting the error message:
> TypeError: Headers contructor: init is a symbol, which cannot be converted to a DOMString.
## Reproducible By
```
const headers = new Headers({'x-fake-header': Symbol('why is this here?')})
```
## Ex... | 2024-11-13T20:13:36Z | 7 | |
nodejs/undici | 3,842 | nodejs__undici-3842 | [
"3869"
] | 1b58a51e203d99cb8441c25044c8f8ed5bc63554 | diff --git a/eslint.config.js b/eslint.config.js
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -7,6 +7,7 @@ module.exports = [
ignores: [
'lib/llhttp',
'test/fixtures/wpt',
+ 'test/fixtures/cache-tests',
'undici-fetch.js'
],
noJsx: true,
diff --git a/lib/cache/memory-cache-st... | diff --git a/test/cache-interceptor/cache-store-test-utils.js b/test/cache-interceptor/cache-store-test-utils.js
--- a/test/cache-interceptor/cache-store-test-utils.js
+++ b/test/cache-interceptor/cache-store-test-utils.js
@@ -58,6 +58,7 @@ function cacheStoreTests (CacheStore) {
deepStrictEqual(await readRespon... | sql cache should always have a entry size limit
We can't store more than 2GB.
| 2024-11-18T21:05:55Z | 7 | |
nodejs/undici | 3,758 | nodejs__undici-3758 | [
"3718"
] | 24df4a5cb0d8718bdb179531e04b869f0d62a03f | diff --git a/lib/cache/memory-cache-store.js b/lib/cache/memory-cache-store.js
--- a/lib/cache/memory-cache-store.js
+++ b/lib/cache/memory-cache-store.js
@@ -91,6 +91,7 @@ class MemoryCacheStore {
statusCode: entry.statusCode,
rawHeaders: entry.rawHeaders,
body: entry.body,
+ ... | diff --git a/test/cache-interceptor/cache-stores.js b/test/cache-interceptor/cache-stores.js
--- a/test/cache-interceptor/cache-stores.js
+++ b/test/cache-interceptor/cache-stores.js
@@ -58,6 +58,7 @@ function cacheStoreTests (CacheStore) {
deepStrictEqual(await readResponse(readResult), {
...requestV... | Easier way to attach `ETag` to `If-None-Match` after #3562
## This would solve...
#3562 introduces HTTP Caching (RFC9110) to undici, which also implements HTTP 304 with `If-Modified-Since`. But it seems that `ETag` is missing.
cc @flakey5
## The implementation should look like...
IMHO #3562 should not be de... | I have a question. In the fetch spec, 304 (along with some other status codes like 101 and 204) are null body status (https://fetch.spec.whatwg.org/#concept-status).
undici could return a "transparent" cached `Response` object with 200 OKs when the server returns 304 (which is also what browsers do), which consists ... | 2024-10-21T23:46:20Z | 7 |
nodejs/undici | 3,631 | nodejs__undici-3631 | [
"3630"
] | 54fd2df4e359ecde137f382af4c4590aea5f0555 | diff --git a/lib/web/cache/cache.js b/lib/web/cache/cache.js
--- a/lib/web/cache/cache.js
+++ b/lib/web/cache/cache.js
@@ -514,6 +514,7 @@ class Cache {
for (const request of requests) {
const requestObject = fromInnerRequest(
request,
+ undefined,
new AbortController().si... | diff --git a/test/fetch/issue-3630.js b/test/fetch/issue-3630.js
new file mode 100644
--- /dev/null
+++ b/test/fetch/issue-3630.js
@@ -0,0 +1,12 @@
+'use strict'
+
+const { test } = require('node:test')
+const assert = require('node:assert')
+const { Request, Agent } = require('../..')
+const { kDispatcher } = require(... | undici.Request.clone does not copy dispatcher
## Bug Description
<!-- A clear and concise description of what the bug is. -->
## Reproducible By
Consider this code:
```
async function test() {
const undici = require('undici');
class CustomAgent extends undici.Agent {
constructor() {
... | 2024-09-20T14:45:57Z | 6.19 | |
nodejs/undici | 3,566 | nodejs__undici-3566 | [
"3546"
] | dca0aa0998cbdef28916b23d6300beb2fd979140 | diff --git a/lib/web/websocket/websocket.js b/lib/web/websocket/websocket.js
--- a/lib/web/websocket/websocket.js
+++ b/lib/web/websocket/websocket.js
@@ -537,6 +537,14 @@ class WebSocket extends EventTarget {
message: reason
})
}
+
+ if (!this.#parser && !this.#handler.receivedClose) {
+ f... | diff --git a/test/websocket/issue-3546.js b/test/websocket/issue-3546.js
--- a/test/websocket/issue-3546.js
+++ b/test/websocket/issue-3546.js
@@ -5,7 +5,7 @@ const { WebSocket } = require('../..')
const { tspl } = require('@matteo.collina/tspl')
test('first error than close event is fired on failed connection', as... | WebSockets do not fire 'close' event if the connection failed to be established
Consider the following code:
```js
const webSocket = new undici.WebSocket("wss://invalid-domain.example.com/");
webSocket.onopen = () => { console.log("open"); };
webSocket.onclose = () => { console.log("close"); };
webSocket.onerror =... | Is it connected to #3506 and maybe already fixed in main but not released yet?
The `close` event is never fired even though the `readyState` is set to 3 (`WebSocket.CLOSED`). Tested on latest commit (4b8958a228aae55366dfba1dc70f03f08bc2d48d) on main.
Code
```typescript
import { WebSocket } from 'undici';
const ... | 2024-09-08T07:40:34Z | 6.19 |
nodejs/undici | 3,495 | nodejs__undici-3495 | [
"3410"
] | b7254574e54d135d41baa5193f89007e78a3c710 | diff --git a/benchmarks/timers/compare-timer-getters.mjs b/benchmarks/timers/compare-timer-getters.mjs
new file mode 100644
--- /dev/null
+++ b/benchmarks/timers/compare-timer-getters.mjs
@@ -0,0 +1,18 @@
+import { bench, group, run } from 'mitata'
+
+group('timers', () => {
+ bench('Date.now()', () => {
+ Date.now... | diff --git a/test/issue-3410.js b/test/issue-3410.js
new file mode 100644
--- /dev/null
+++ b/test/issue-3410.js
@@ -0,0 +1,88 @@
+'use strict'
+
+const { tspl } = require('@matteo.collina/tspl')
+const { fork } = require('node:child_process')
+const { resolve: pathResolve } = require('node:path')
+const { describe, te... | `UND_ERR_CONNECT_TIMEOUT` errors thrown when there is CPU intensive code on the event loop
## Bug Description
Work on the event loop can interrupt the Undici lifecycle for making requests, causing errors to be thrown even when there is no problem with the underlying connection. For example, if a fetch request is sta... | I think something like this would also do the trick:
```js
diff --git a/lib/util/timers.js b/lib/util/timers.js
index d0091cc1..fa56be8b 100644
--- a/lib/util/timers.js
+++ b/lib/util/timers.js
@@ -2,13 +2,13 @@
const TICK_MS = 499
-let fastNow = Date.now()
+let fastNow = 0
let fastNowTimeout
c... | 2024-08-23T14:56:16Z | 6.19 |
nodejs/undici | 3,505 | nodejs__undici-3505 | [
"1125"
] | ba8c0739e4a6cc20c8f00aa78b14548486f416a8 | diff --git a/lib/api/readable.js b/lib/api/readable.js
--- a/lib/api/readable.js
+++ b/lib/api/readable.js
@@ -201,6 +201,17 @@ class BodyReadable extends Readable {
.resume()
})
}
+
+ /**
+ * @param {BufferEncoding} encoding
+ * @returns {BodyReadable}
+ */
+ setEncoding (encoding) {
+ if (... | diff --git a/test/client-request.js b/test/client-request.js
--- a/test/client-request.js
+++ b/test/client-request.js
@@ -220,7 +220,7 @@ test('request body destroyed on invalid callback', async (t) => {
after(() => client.destroy())
const body = new Readable({
- read () {}
+ read () { }
})
... | client.request throws Error with setEncoding
## Bug Description
`client.request` throws an error when `body.json()` & `body.text()` are called with `setEncoding`.
## Reproducible By
```javascript
import { createServer } from 'http'
import { Client } from 'undici'
import { once } from 'events'
import assert... | > I think that this code needs to use consume.stream._readableState.decoder.end() in consumeEnd instead of Buffer.concat(body) if the value is in readableEncoding.
Is this the right way to fix it?
Just check if elements in body are string or Buffer and concat accordingly.
I think that mixing strings and buffers cou... | 2024-08-25T02:12:43Z | 6.19 |
nodejs/undici | 3,294 | nodejs__undici-3294 | [
"3288"
] | 18af4b07c3602c09a432c07e0c305deed5fbb08c | diff --git a/lib/core/symbols.js b/lib/core/symbols.js
--- a/lib/core/symbols.js
+++ b/lib/core/symbols.js
@@ -20,6 +20,7 @@ module.exports = {
kHost: Symbol('host'),
kNoRef: Symbol('no ref'),
kBodyUsed: Symbol('used'),
+ kBody: Symbol('abstracted request body'),
kRunning: Symbol('running'),
kBlocking: ... | diff --git a/test/retry-handler.js b/test/retry-handler.js
--- a/test/retry-handler.js
+++ b/test/retry-handler.js
@@ -4,6 +4,7 @@ const { tspl } = require('@matteo.collina/tspl')
const { test, after } = require('node:test')
const { createServer } = require('node:http')
const { once } = require('node:events')
+const... | Retry Handler Fails When Request Has a Body
## Bug Description
When a body is provided to a request, such as in a `PUT` request, the retry handler fails with `UND_ERR_REQ_CONTENT_LENGTH_MISMATCH`.
## Reproducible By
repro.ts:
```
import http from 'http';
import { Agent, RetryAgent } from 'undici';
cons... | This is indeed tricky. On one hand, state altering verbs should not be automatically retried, on the other hand, it's a pretty common case.
It might be better to just scope this to the safe methods only `GET`, `HEAD`, and `OPTIONS` instead of the idempotent ones.
Tho the issue seems to root the `AsyncIterable` t... | 2024-05-22T10:41:18Z | 6.18 |
nodejs/undici | 3,251 | nodejs__undici-3251 | [
"3249"
] | 033530df602d32bfe1dec22c97215f75a9afc433 | diff --git a/lib/web/websocket/connection.js b/lib/web/websocket/connection.js
--- a/lib/web/websocket/connection.js
+++ b/lib/web/websocket/connection.js
@@ -261,13 +261,9 @@ function closeWebSocketConnection (ws, code, reason, reasonByteLength) {
/** @type {import('stream').Duplex} */
const socket = ws[kRes... | diff --git a/test/autobahn/.gitignore b/test/autobahn/.gitignore
new file mode 100644
--- /dev/null
+++ b/test/autobahn/.gitignore
@@ -0,0 +1 @@
+reports/clients
diff --git a/test/autobahn/client.js b/test/autobahn/client.js
new file mode 100644
--- /dev/null
+++ b/test/autobahn/client.js
@@ -0,0 +1,47 @@
+'use strict'... | running autobahn test suite
We cannot move WebSocket out from experimental until we run the autobahn test suite.
https://github.com/crossbario/autobahn-testsuite
| 2024-05-12T19:45:58Z | 6.16 | |
nodejs/undici | 3,206 | nodejs__undici-3206 | [
"3080"
] | 6866d2992b1d6bef05f8d503f1bcba9f6ddc1c7e | diff --git a/lib/web/websocket/connection.js b/lib/web/websocket/connection.js
--- a/lib/web/websocket/connection.js
+++ b/lib/web/websocket/connection.js
@@ -1,13 +1,14 @@
'use strict'
-const { uid, states, sentCloseFrameState } = require('./constants')
+const { uid, states, sentCloseFrameState, emptyBuffer, opcode... | diff --git a/test/websocket/client-received-masked-frame.js b/test/websocket/client-received-masked-frame.js
new file mode 100644
--- /dev/null
+++ b/test/websocket/client-received-masked-frame.js
@@ -0,0 +1,45 @@
+'use strict'
+
+const { test } = require('node:test')
+const { once } = require('node:events')
+const { W... | websocket: fix ByteParser.run and parseCloseBody
ParseCloseBody can return null. In that case this.#info.closeInfo would be null and the following line would result in a crash.
https://github.com/nodejs/undici/blob/5d5454380b72889706146a9c4d5f65225a99640f/lib/web/websocket/receiver.js#L111
Also reduces the amou... | ## [Codecov](https://app.codecov.io/gh/nodejs/undici/pull/3080?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nodejs) Report
Attention: Patch coverage is `87.50000%` with `2 lines` in your changes are missing coverage. Please review.
> Project ... | 2024-05-05T22:57:41Z | 6.15 |
nodejs/undici | 3,169 | nodejs__undici-3169 | [
"2227"
] | 3f927b8ef17791109cbb4f427b3e98ec4db9df25 | diff --git a/lib/web/fetch/request.js b/lib/web/fetch/request.js
--- a/lib/web/fetch/request.js
+++ b/lib/web/fetch/request.js
@@ -38,6 +38,8 @@ const requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
signal.removeEventListener('abort', abort)
})
+const dependentControllerMap = new WeakMap()
+
... | diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json
--- a/test/wpt/status/fetch.status.json
+++ b/test/wpt/status/fetch.status.json
@@ -2,13 +2,11 @@
"api": {
"abort": {
"general.any.js": {
- "note": "TODO(@KhafraDev): Clone aborts with original controller can probab... | abortcontroller & request.clone issue with fetch
```js
import { Request } from 'undici'
import { ok, strictEqual } from 'node:assert'
const controller = new AbortController();
const signal = controller.signal;
const request = new Request('http://a', { signal });
const clonedRequest = request.clone... | 2024-04-26T12:53:22Z | 6.14 | |
nodejs/undici | 3,105 | nodejs__undici-3105 | [
"3097"
] | 8f192e3748f045e07d1cd8cc892a8433dd31bc32 | diff --git a/lib/web/fetch/body.js b/lib/web/fetch/body.js
--- a/lib/web/fetch/body.js
+++ b/lib/web/fetch/body.js
@@ -406,7 +406,7 @@ async function consumeBody (object, convertBytesToJSValue, instance) {
// 1. If object is unusable, then return a promise rejected
// with a TypeError.
if (bodyUnusable(obje... | diff --git a/test/fetch/client-fetch.js b/test/fetch/client-fetch.js
--- a/test/fetch/client-fetch.js
+++ b/test/fetch/client-fetch.js
@@ -370,7 +370,7 @@ test('locked blob body', (t, done) => {
const res = await fetch(`http://localhost:${server.address().port}`)
const reader = res.body.getReader()
res.b... | Change "Body is unusable" error to something more helpful
## This would solve...
Unidici throws an error with the message "Body is unusable" when the body of a response is non-null and the stream is either locked or disturbed. In most cases, this situation occurs because someone has attempted to ready the body twice... | Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
I am not certain that the body can be null there
@mcollina happy to! :tada:
If I had to implement it, I would do it like this:
```js
// symbols.js
const kBodyOk = Symbol('body_ok')
const kBodyLocked = Sy... | 2024-04-12T22:11:28Z | 6.13 |
nodejs/undici | 3,047 | nodejs__undici-3047 | [
"3046"
] | dde070b53206022051da9dffb2df220b75759d5c | diff --git a/lib/dispatcher/client-h2.js b/lib/dispatcher/client-h2.js
--- a/lib/dispatcher/client-h2.js
+++ b/lib/dispatcher/client-h2.js
@@ -55,14 +55,20 @@ const {
} = http2
function parseH2Headers (headers) {
- // set-cookie is always an array. Duplicates are added to the array.
- // For duplicate cookie head... | diff --git a/test/fetch/http2.js b/test/fetch/http2.js
--- a/test/fetch/http2.js
+++ b/test/fetch/http2.js
@@ -462,3 +462,48 @@ test('Issue #2386', async (t) => {
controller.abort()
ok(true)
})
+
+test('Issue #3046', async (t) => {
+ const server = createSecureServer(pem)
+
+ const { strictEqual, deepStrictEqu... | Exception parsing HTTP/2 Headers when multiple set-cookie is sent
## Bug Description
By making requests to websites that return multiple set-cookie header with HTTP/2 enabled, an exception is triggered while processing the headers
## Reproducible By
https://replit.com/@gava97/H2-headers
## Expected Behavior... | Yes, we changed the way we parse the response headers; it seems the root cause goes to the way we parse the `setCookie`, as with `node:http2`, multiple `set-cookie` headers are consolidated into an array of multiple values, we need to change that so `fetch` can parse it accordingly to the spec.
Working on a fix | 2024-04-03T09:05:32Z | 6.11 |
nodejs/undici | 3,005 | nodejs__undici-3005 | [
"2364"
] | 7485cd9b4cf9a86cb76b1597df527eba15755bfc | diff --git a/lib/dispatcher/client-h2.js b/lib/dispatcher/client-h2.js
--- a/lib/dispatcher/client-h2.js
+++ b/lib/dispatcher/client-h2.js
@@ -391,6 +391,18 @@ function writeH2 (client, request) {
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers
request.onResponseStarted()
+ // Due t... | diff --git a/test/http2.js b/test/http2.js
--- a/test/http2.js
+++ b/test/http2.js
@@ -1294,3 +1294,88 @@ test('Should throw informational error on half-closed streams (remote)', async t
t.strictEqual(err.code, 'UND_ERR_INFO')
})
})
+
+test('#2364 - Concurrent aborts', async t => {
+ const server = createSecu... | [HTTP/2] Aborted requests for same domain might fail unexpectedly
## Bug Description
As the title, pipelined requests might fail unexpectedly if another request toward the same domain has been aborted:
```
node:assert:399
throw err;
^
AssertionError [ERR_ASSERTION]: The expression evaluated to a fal... | @metcoder95
Started doing some research about, and bug is in fact quite complex; it seems that somewhere we are reusing a `request` instance that was already aborted to handle a second request. Haven't found the root cause yet. I'll made more research later on
The repro SukkaW provided still reproduces even with Pipel... | 2024-03-27T11:43:24Z | 6.1 |
nodejs/undici | 2,992 | nodejs__undici-2992 | [
"2986"
] | 83f36b73eedf60a9eadb0020db29a38f4e727980 | diff --git a/lib/handler/retry-handler.js b/lib/handler/retry-handler.js
--- a/lib/handler/retry-handler.js
+++ b/lib/handler/retry-handler.js
@@ -242,14 +242,12 @@ class RetryHandler {
}
const { start, size, end = size } = range
-
assert(
- start != null && Number.isFinite(start) ... | diff --git a/test/retry-handler.js b/test/retry-handler.js
--- a/test/retry-handler.js
+++ b/test/retry-handler.js
@@ -876,3 +876,106 @@ test('Should be able to properly pass the minTimeout to the RetryContext when co
await t.completed
})
+test('Issue#2986 - Handle custom 206', { only: true }, async t => {
+ t =... | Fails to retrieve the first piece of data when downloading partial content with `RetryAgent`
## Bug Description
<!-- A clear and concise description of what the bug is. -->
When trying to download the file in parts (using `RetryAgent`), the download of the first part (when first byte of range is equal to zero) fa... | 2024-03-25T09:49:08Z | 6.1 | |
nodejs/undici | 2,939 | nodejs__undici-2939 | [
"2926"
] | 219da8b7b3fea7e38a7644b8bc35fe6fec97d66e | diff --git a/lib/core/errors.js b/lib/core/errors.js
--- a/lib/core/errors.js
+++ b/lib/core/errors.js
@@ -195,6 +195,16 @@ class RequestRetryError extends UndiciError {
}
}
+class SecureProxyConnectionError extends UndiciError {
+ constructor (cause, message, options) {
+ super(message, { cause, ...(options ... | diff --git a/test/fixtures/client-ca-crt.pem b/test/fixtures/client-ca-crt.pem
deleted file mode 100644
--- a/test/fixtures/client-ca-crt.pem
+++ /dev/null
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICqDCCAZACCQC0Hman8CosTDANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDDApu
-b2RlanMub3JnMCAXDTIyMDcxOTE2MzQwMloYDzIxMjIwNzIwMTY... | ProxyAgent sends wrong SNI to proxy
## Bug Description
When using an encrypted connection for a proxy with the `ProxyAgent` the hostname from the actual request is used instead of the hostname from the proxy URI.
## Reproducible By
Run the following script and observe that the first client hello contains the hos... | Yeah, sounds fair, that can cause potential side effects on TLS negotiations.
Though, I'll try so scope this within `ProxyAgent` instead of directly pointing to `connect.js`.
would you like to send a PR to fix that? Do not forget the unit testing 🙂 | 2024-03-10T08:54:56Z | 6.7 |
apollographql/apollo-client | 12,450 | apollographql__apollo-client-12450 | [
"12192"
] | 925548a9baadb19b7bb78ee84c6f9e64b55c39e9 | diff --git a/integration-tests/next/src/libs/apolloClient.ts b/integration-tests/next/src/libs/apolloClient.ts
--- a/integration-tests/next/src/libs/apolloClient.ts
+++ b/integration-tests/next/src/libs/apolloClient.ts
@@ -16,7 +16,7 @@ import { schemaLink } from "./schemaLink.ts";
export const APOLLO_STATE_PROP_NAM... | diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts
--- a/src/__tests__/client.ts
+++ b/src/__tests__/client.ts
@@ -15,6 +15,7 @@ import {
createFragmentRegistry,
InMemoryCache,
makeVar,
+ NormalizedCacheObject,
PossibleTypesMap,
} from "@apollo/client/cache";
import {
@@ -3735,7 +3736,7 @@ de... | [4.0] Remove `TCacheShape` generic argument on `ApolloClient`
`TCacheShape` hasn't provided a ton of type-safety value so we plan to remove it in 4.0
| 2025-03-17T19:09:24Z | 4 | |
apollographql/apollo-client | 12,451 | apollographql__apollo-client-12451 | [
"12306"
] | 876d07042cf3348b3769b2bb415aa5f70ce9844c | diff --git a/src/cache/core/cache.ts b/src/cache/core/cache.ts
--- a/src/cache/core/cache.ts
+++ b/src/cache/core/cache.ts
@@ -106,10 +106,10 @@ export abstract class ApolloCache implements DataProxy {
// required to implement
// core API
- public abstract read<TData = any, TVariables = any>(
+ public abstrac... | diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts
--- a/src/__tests__/ApolloClient.ts
+++ b/src/__tests__/ApolloClient.ts
@@ -2785,7 +2785,7 @@ describe("ApolloClient", () => {
client.setLink(newLink);
- const { data } = await client.query({
+ const { data } = await client.... | [4.0] Default `TData` types in query APIs to `unknown` instead of `any`
Switching from `any` to `unknown` should provide better type safety in cases where we don't know the type of `TData`. Using `any` is largely considered a bad practice if you can avoid it.
| 2025-03-17T21:36:21Z | 4 | |
apollographql/apollo-client | 12,497 | apollographql__apollo-client-12497 | [
"12483"
] | d3383033d306b7d66e90f5f3170c24453cd76464 | diff --git a/src/config/jest/areCombinedGraphQLErrorsEqual.ts b/src/config/jest/areCombinedGraphQLErrorsEqual.ts
--- a/src/config/jest/areCombinedGraphQLErrorsEqual.ts
+++ b/src/config/jest/areCombinedGraphQLErrorsEqual.ts
@@ -12,7 +12,9 @@ export const areCombinedGraphQLErrorsEqual: Tester = function (
if (isACom... | diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts
--- a/src/__tests__/client.ts
+++ b/src/__tests__/client.ts
@@ -593,7 +593,7 @@ describe("client", () => {
});
await expect(client.query({ query })).rejects.toEqual(
- new CombinedGraphQLErrors(errors)
+ new CombinedGraphQLErrors({ err... | [4.0] Add `data` property to `CombinedGraphQLErrors` to access partial data
When using `errorPolicy: 'none'` (the default), data returned from the server is discarded when errors are also returned. We'd like to make any partial data returned from the server available on the `CombinedGraphQLErrors` instance.
| 2025-03-28T22:24:53Z | 4 | |
apollographql/apollo-client | 12,533 | apollographql__apollo-client-12533 | [
"12529"
] | ae0dcad89924e6b8090ca3182df30e528589b562 | diff --git a/src/link/core/ApolloLink.ts b/src/link/core/ApolloLink.ts
--- a/src/link/core/ApolloLink.ts
+++ b/src/link/core/ApolloLink.ts
@@ -1,4 +1,4 @@
-import type { Observable, Subscriber } from "rxjs";
+import type { Observable } from "rxjs";
import { EMPTY } from "rxjs";
import {
@@ -138,29 +138,6 @@ export ... | diff --git a/src/__tests__/mutationResults.ts b/src/__tests__/mutationResults.ts
--- a/src/__tests__/mutationResults.ts
+++ b/src/__tests__/mutationResults.ts
@@ -164,9 +164,7 @@ describe("mutation results", () => {
delay,
},
...mockedResponses
- ).setOnError((error) => {
- thro... | [4.0] Remove `setOnError` and `onError` from `ApolloLink`
These APIs are only used by `MockLink` and appear to only be there to rewrite errors. This code is not called anywhere else. We'd prefer to remove this API.
| 2025-04-04T21:57:23Z | 4 | |
apollographql/apollo-client | 12,379 | apollographql__apollo-client-12379 | [
"12184"
] | 9ed45c503a55c777138b60ce5fc905749dc538aa | diff --git a/src/cache/inmemory/inMemoryCache.ts b/src/cache/inmemory/inMemoryCache.ts
--- a/src/cache/inmemory/inMemoryCache.ts
+++ b/src/cache/inmemory/inMemoryCache.ts
@@ -49,7 +49,6 @@ export class InMemoryCache extends ApolloCache<NormalizedCacheObject> {
protected config: InMemoryCacheConfig;
private watc... | diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts
--- a/src/__tests__/ApolloClient.ts
+++ b/src/__tests__/ApolloClient.ts
@@ -1178,7 +1178,6 @@ describe("ApolloClient", () => {
return result.__typename + result.id;
}
},
- addTypename: true... | [4.0] Deprecate `addTypename` option in `InMemoryCache`
`__typename` is incredibly important to Apollo Client, especially `InMemoryCache` which allows normalization to work correctly. We'd like to deprecate and remove the `addTypename` option in 4.0.
| 2025-02-14T23:19:51Z | 3.13 | |
apollographql/apollo-client | 12,300 | apollographql__apollo-client-12300 | [
"8958"
] | af3a90a05dbdabac9365297478bfa5f0382bcf9c | diff --git a/config/entryPoints.js b/config/entryPoints.js
--- a/config/entryPoints.js
+++ b/config/entryPoints.js
@@ -27,6 +27,7 @@ const entryPoints = [
{ dirs: ["testing"], extensions: [".js", ".jsx"] },
{ dirs: ["testing", "core"] },
{ dirs: ["testing", "experimental"] },
+ { dirs: ["testing", "react"] },... | diff --git a/docs/source/api/react/testing.md b/docs/source/api/react/testing.md
--- a/docs/source/api/react/testing.md
+++ b/docs/source/api/react/testing.md
@@ -11,7 +11,7 @@ api_reference: true
```js
-import { MockedProvider } from "@apollo/client/testing";
+import { MockedProvider } from "@apollo/client/testin... | Apollo client requires react ?!?
Hi guys!
Thank you for the great project it opens up many possibilities using graphql!
I am an early bird user from the moment that apollo introduced apollo-client!
I have created a package called `@rxdi/graphql-client ` which helps me to wrap all of the `apollo-client logic... | This is something we’re trying to fix, but will have to wait til a major version release, as it would be a breaking change. For now, you will have to continue importing the client from the `@apollo/client/core` entry point. At some point, we do hope to isolate the different entry points so that other framework users do... | 2025-01-22T21:45:52Z | 3.12 |
apollographql/apollo-client | 12,224 | apollographql__apollo-client-12224 | [
"12190"
] | 69c1cb6f831941598987185238a299b050a364bd | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -308,7 +308,6 @@ export class ObservableQuery<
if (
__DEV__ &&
!diff.complete &&
- !this.options.partialRefetch &&
!result.loading &&
... | diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts
--- a/src/__tests__/ApolloClient.ts
+++ b/src/__tests__/ApolloClient.ts
@@ -2724,7 +2724,6 @@ describe("ApolloClient", () => {
pollInterval: 100,
notifyOnNetworkStatusChange: true,
returnPartialData: true,
... | [4.0] Remove deprecated `partialRefetch` option
https://www.apollographql.com/docs/react/data/queries#queryhookoptions-interface-partialrefetch
| 2024-12-13T20:28:02Z | 3.12 | |
apollographql/apollo-client | 12,254 | apollographql__apollo-client-12254 | [
"12206"
] | 51e6c0f8657d20cedc570c6e9a244f877047dd61 | diff --git a/src/link/http/selectHttpOptionsAndBody.ts b/src/link/http/selectHttpOptionsAndBody.ts
--- a/src/link/http/selectHttpOptionsAndBody.ts
+++ b/src/link/http/selectHttpOptionsAndBody.ts
@@ -105,7 +105,7 @@ const defaultHttpOptions: HttpQueryOptions = {
const defaultHeaders = {
// headers are case insensi... | diff --git a/src/link/batch-http/__tests__/batchHttpLink.ts b/src/link/batch-http/__tests__/batchHttpLink.ts
--- a/src/link/batch-http/__tests__/batchHttpLink.ts
+++ b/src/link/batch-http/__tests__/batchHttpLink.ts
@@ -610,7 +610,7 @@ describe("SharedHttpTest", () => {
.headers as Record<string, string>;
... | [4.0] Switch to `application/graphql-response+json` as default `Accept` header
https://graphql.org/learn/serving-over-http/
Spec: https://graphql.github.io/graphql-over-http/draft/#sec-Media-Types
| 2025-01-07T23:37:01Z | 3.12 | |
apollographql/apollo-client | 12,121 | apollographql__apollo-client-12121 | [
"11678"
] | 3b6b6cc09c070996da045d1b50593ec290a99419 | diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts
--- a/src/core/ApolloClient.ts
+++ b/src/core/ApolloClient.ts
@@ -510,6 +510,8 @@ export class ApolloClient<TCacheShape> implements DataProxy {
>(
options: SubscriptionOptions<TVariables, T>
): Observable<FetchResult<MaybeMasked<T>>> {
+ con... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -465,6 +465,7 @@ Array [
"isExecutionPatchInitialResult",
"isExecutionPatchResult",
"isField",
+ "isFull... | [Data masking] Allow `useFragment` to work with `no-cache` queries
Subject to change based on technical exploration
| As a starting point, we are going to leave `useFragment` alone because introducing support for `no-cache` would turn it into a "polymorphic" hook which might be confusing.
Instead, we plan to warn when using `no-cache` with data masking and require that you use `@unmask` in order to get the full data result. This op... | 2024-11-13T00:03:41Z | 3.11 |
apollographql/apollo-client | 12,367 | apollographql__apollo-client-12367 | [
"12100"
] | 8b1390bf0050c6bd4d5a32b67c3b96369d0552d4 | diff --git a/src/react/hooks/useLazyQuery.ts b/src/react/hooks/useLazyQuery.ts
--- a/src/react/hooks/useLazyQuery.ts
+++ b/src/react/hooks/useLazyQuery.ts
@@ -1,37 +1,165 @@
import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
+import { equal } from "@wry/equality";
import type { DocumentNode }... | diff --git a/src/react/hooks/__tests__/useLazyQuery.test.tsx b/src/react/hooks/__tests__/useLazyQuery.test.tsx
--- a/src/react/hooks/__tests__/useLazyQuery.test.tsx
+++ b/src/react/hooks/__tests__/useLazyQuery.test.tsx
@@ -1,22 +1,27 @@
-import { act, renderHook, waitFor } from "@testing-library/react";
+import { act, ... | `useMutation`/`useLazyQuery` execution functions always requires full variables when using TypedDocumentNode
### Issue Description
The documentation for hooks like [`useMutation`](https://www.apollographql.com/docs/react/data/mutations#option-precedence) and [`useLazyQuery`](https://www.apollographql.com/docs/react/... | Hey @maciesielka 👋
Good catch! FYI the team is away at a conference this week so we won't be able to look at this until at least next week. Thanks for raising the issue!
Hi @jerelmiller, can I have a try at this if possible?
@naman1608 absolutely!
@jerelmiller, I have a doubt if you could take a look? Should `Muta... | 2025-02-12T04:37:29Z | 3.13 |
apollographql/apollo-client | 12,052 | apollographql__apollo-client-12052 | [
"12051"
] | 40d21f17e300c4498b22642803f3907bbd55064f | diff --git a/src/cache/core/cache.ts b/src/cache/core/cache.ts
--- a/src/cache/core/cache.ts
+++ b/src/cache/core/cache.ts
@@ -229,7 +229,16 @@ export abstract class ApolloCache<TSerialized> implements DataProxy {
const diffOptions: Cache.DiffOptions<TData, TVars> = {
...otherOptions,
returnPartialDa... | diff --git a/src/react/hooks/__tests__/useFragment.test.tsx b/src/react/hooks/__tests__/useFragment.test.tsx
--- a/src/react/hooks/__tests__/useFragment.test.tsx
+++ b/src/react/hooks/__tests__/useFragment.test.tsx
@@ -1725,6 +1725,34 @@ describe("useFragment", () => {
});
});
});
+
+ // https://github.... | UseFragment producing a warning during store misses (TypeError: Cannot read properties of undefined)
### Issue Description
Since @apollo/client 3.11.5 I've started receiving warnings in the console during store misses of useFragment in development: `TypeError: Cannot read properties of undefined (reading '__typename')... | Hey @alex-e-leon!
You beat me to opening this 😆. I discovered this just recently working with the data masking feature. We did some rework with `useFragment` to ensure it follows the Rules of React (specifically not writing to `ref` in render), but I just found out that causes this warning. I know exactly where the... | 2024-09-03T20:00:03Z | 3.11 |
apollographql/apollo-client | 11,944 | apollographql__apollo-client-11944 | [
"11945"
] | c4cf5774bedb4da7b5b21ecb4de263a7217285a7 | diff --git a/src/core/watchQueryOptions.ts b/src/core/watchQueryOptions.ts
--- a/src/core/watchQueryOptions.ts
+++ b/src/core/watchQueryOptions.ts
@@ -220,7 +220,10 @@ export interface MutationBaseOptions<
/** {@inheritDoc @apollo/client!MutationOptionsDocumentation#optimisticResponse:member} */
optimisticRespons... | diff --git a/src/__tests__/optimistic.ts b/src/__tests__/optimistic.ts
--- a/src/__tests__/optimistic.ts
+++ b/src/__tests__/optimistic.ts
@@ -9,6 +9,7 @@ import {
ApolloLink,
ApolloCache,
MutationQueryReducersMap,
+ TypedDocumentNode,
} from "../core";
import { QueryManager } from "../core/QueryManager";... | Type error returning `IGNORE` object when using a generic `TypedDocumentNode` mutation
### Issue Description
There's a type error when returning the `IGNORE` sentinel object from `optimisticResponse` that is inferring from a `TypedDocumentNode<>`.
Given the following document:
 => {
});
});
+describe("i... | Add an `ignoreResults` option to the `useSubscription` API
### Overview
Some issues have been brought to our attention that the `useSubscription` [API](https://www.apollographql.com/docs/react/data/subscriptions#options) doesn't have an option of [ignoreResults](https://www.apollographql.com/docs/react/data/mutatio... | +10000 | 2024-07-03T13:56:00Z | 3.1 |
apollographql/apollo-client | 11,923 | apollographql__apollo-client-11923 | [
"11818"
] | 5ae4876457391d4fbb8da56878425610c4d37fb6 | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -163,6 +163,8 @@ export class ObservableQuery<
this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy);
this.isTornDown = false;
+ this.subscribeToMore = thi... | diff --git a/src/react/hooks/__tests__/useBackgroundQuery.test.tsx b/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
--- a/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
+++ b/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
@@ -16,6 +16,7 @@ import {
TypedDocumentNode,
ApolloLink,
Observable... | Add `subscribeToMore` functionality to `useQueryRefHandlers`, `useBackgroundQuery`
Context: https://community.apollographql.com/t/how-to-use-subscriptions-together-with-preloadquery/7434/3
Some of our hooks include `subscribeToMore` in the results object. We want to ensure that all relevant hooks include `subscribe... | 2024-07-03T21:12:02Z | 3.1 | |
apollographql/apollo-client | 11,799 | apollographql__apollo-client-11799 | [
"11798"
] | 60592e95399c3695d1d49a4c39ad29f00d4059fd | diff --git a/src/react/ssr/RenderPromises.ts b/src/react/ssr/RenderPromises.ts
--- a/src/react/ssr/RenderPromises.ts
+++ b/src/react/ssr/RenderPromises.ts
@@ -1,8 +1,9 @@
-import type { DocumentNode } from "graphql";
import type * as ReactTypes from "react";
import type { ObservableQuery, OperationVariables } from ... | diff --git a/src/react/ssr/__tests__/useQuery.test.tsx b/src/react/ssr/__tests__/useQuery.test.tsx
--- a/src/react/ssr/__tests__/useQuery.test.tsx
+++ b/src/react/ssr/__tests__/useQuery.test.tsx
@@ -2,12 +2,17 @@
import React from "react";
import { DocumentNode } from "graphql";
import gql from "graphql-tag";
-impor... | useQuery fails to resolve ssr renderPromise due to JSON.stringify reordering
### Issue Description
We found a bug in production where the [`lookupQueryInfo()`](https://github.com/apollographql/apollo-client/blob/main/src/react/ssr/RenderPromises.ts#L140) method would consistently not render a SSR component after calli... | That's interesting - are you passing different variables in different situations here?
I don't think that Apollo Client ever touches variables in a writing manner, and JSON.stringify would always stringify things in the object order.
That said, using `canonicalStringify` absolutely makes sense here. I'll prepar... | 2024-04-22T14:31:51Z | 3.1 |
apollographql/apollo-client | 11,638 | apollographql__apollo-client-11638 | [
"11315"
] | f1d8bc40c3d8e39340f721f4f1c3fd0ed77b8a6b | diff --git a/src/react/internal/cache/QueryReference.ts b/src/react/internal/cache/QueryReference.ts
--- a/src/react/internal/cache/QueryReference.ts
+++ b/src/react/internal/cache/QueryReference.ts
@@ -379,10 +379,22 @@ export class InternalQueryReference<TData = unknown> {
// promise is resolved correctly.
... | diff --git a/src/react/hooks/__tests__/useBackgroundQuery.test.tsx b/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
--- a/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
+++ b/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
@@ -4927,25 +4927,6 @@ describe("fetchMore", () => {
expect(renderedCo... | Pagination using useSuspenseQuery and React transition is broken
I have a paginated query that I use with `useSuspenseQuery`.
When I call the `fetchMore` function inside a `startTransition`, an unexpected re-render with **only** the new data happens before the final re-render with all the data merged together.
I'v... | Thanks for reporting this, @pvandamme! Really appreciate the reproduction - looks like this issue should be transferred over to the Apollo Client repo which I will do shortly.
Thanks @alessbell :)
Hi @alessbell, any issue that I can follow on the apollo client repo for updates ?
Thanks !
Faced a similar issue.
Se... | 2024-03-04T22:12:13Z | 3.9 |
apollographql/apollo-client | 11,403 | apollographql__apollo-client-11403 | [
"11201"
] | e855d00447e4d9ae478d98f6796d842ef6cc76d1 | diff --git a/src/react/hooks/useLazyQuery.ts b/src/react/hooks/useLazyQuery.ts
--- a/src/react/hooks/useLazyQuery.ts
+++ b/src/react/hooks/useLazyQuery.ts
@@ -78,7 +78,7 @@ export function useLazyQuery<
// Use refs to track options and the used query to ensure the `execute`
// function remains referentially sta... | diff --git a/src/react/hooks/__tests__/useLazyQuery.test.tsx b/src/react/hooks/__tests__/useLazyQuery.test.tsx
--- a/src/react/hooks/__tests__/useLazyQuery.test.tsx
+++ b/src/react/hooks/__tests__/useLazyQuery.test.tsx
@@ -5,6 +5,7 @@ import { act, render, renderHook, waitFor } from "@testing-library/react";
import ... | v3.8.3 useLazyQuery fires 2 times -unsure why
### Issue Description
We are getting 2 calls in Apollo Client when using useLazyQuery. It is exactly the same call, and passes the Authentication: Bearer header. I confirmed we are only calling the 1st parameter 1 time. And even put in a console.log('FIRE'); and only get 1... | Hey @billnbell 👋
Would you be able to provide a minimal reproduction of the issue? Without code samples or a reproduction to play with, its very difficult to determine what might be happening here. Any more information you can provide would be super helpful. Thanks!
OK - I will send more. But any debug mode I can ... | 2023-12-01T20:09:00Z | 3.9 |
apollographql/apollo-client | 11,200 | apollographql__apollo-client-11200 | [
"11199"
] | e5acf910e39752b453540b6751046d1c19b66350 | diff --git a/.size-limit.cjs b/.size-limit.cjs
--- a/.size-limit.cjs
+++ b/.size-limit.cjs
@@ -1,7 +1,7 @@
const checks = [
{
path: "dist/apollo-client.min.cjs",
- limit: "37972",
+ limit: "37975",
},
{
path: "dist/main.cjs",
@@ -10,7 +10,7 @@ const checks = [
{
path: "dist/index.js",
... | diff --git a/src/__tests__/ApolloClient.ts b/src/__tests__/ApolloClient.ts
--- a/src/__tests__/ApolloClient.ts
+++ b/src/__tests__/ApolloClient.ts
@@ -4,7 +4,6 @@ import {
ApolloClient,
ApolloError,
DefaultOptions,
- FetchPolicy,
QueryOptions,
makeReference,
} from "../core";
@@ -2126,8 +2125,8 @@ desc... | Enable `strict` setting in tsconfig.json
### Issue Description
Our codebase does not currently use the `strict` setting for our codebase. Enabling this causes our codebase to fail due to the [`strictFunctionTypes` rule](https://www.typescriptlang.org/tsconfig#strictFunctionTypes).
As a best practice, we should be u... | 2023-09-07T17:19:47Z | 3.8 | |
apollographql/apollo-client | 11,180 | apollographql__apollo-client-11180 | [
"11179"
] | 6b8198109bd9fe5eedf352421a0a773ac0acfb18 | diff --git a/.size-limit.cjs b/.size-limit.cjs
--- a/.size-limit.cjs
+++ b/.size-limit.cjs
@@ -1,7 +1,7 @@
const checks = [
{
path: "dist/apollo-client.min.cjs",
- limit: "38107",
+ limit: "38190",
},
{
path: "dist/main.cjs",
@@ -10,7 +10,7 @@ const checks = [
{
path: "dist/index.js",
... | diff --git a/src/react/hooks/__tests__/useBackgroundQuery.test.tsx b/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
--- a/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
+++ b/src/react/hooks/__tests__/useBackgroundQuery.test.tsx
@@ -3503,6 +3503,258 @@ describe("useBackgroundQuery", () => {
},
... | `useBackgroundQuery` hangs on loading when refetching after error
### Issue Description
When an error is encountered in `useBackgroundQuery`/`useReadQuery`, an error is thrown to the nearest suspense boundary. In some cases, users may want to execute a `refetch` from the error boundary to try the query again. When e... | 2023-08-30T03:29:55Z | 3.8 | |
apollographql/apollo-client | 11,078 | apollographql__apollo-client-11078 | [
"10912"
] | 62f3b6d0e89611e27d9f29812ee60e5db5963fd6 | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -906,12 +906,16 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`,
const { concast, fromLink } = this.fetch(options, newNetworkStatus, query);
... | diff --git a/src/__tests__/mutationResults.ts b/src/__tests__/mutationResults.ts
--- a/src/__tests__/mutationResults.ts
+++ b/src/__tests__/mutationResults.ts
@@ -1186,8 +1186,6 @@ describe("mutation results", () => {
subscribeAndCount(reject, watchedQuery, (count, result) => {
if (count === 1) {
- ... | Add failing test for cache consistency bug
Since the bug is really specific, I've submitted a failing test case instead of a bug report—hope this helps!
<!--
Thanks for filing a pull request on Apollo Client!
A few automated bots may chime in on your PR. They are here to help
with reviewing and ensuring A... | 2023-07-18T11:38:10Z | 3.9 | |
apollographql/apollo-client | 10,853 | apollographql__apollo-client-10853 | [
"10767"
] | e3c676deb59d006f33d24a7211e58725a67641b8 | diff --git a/config/entryPoints.js b/config/entryPoints.js
--- a/config/entryPoints.js
+++ b/config/entryPoints.js
@@ -11,6 +11,7 @@ const entryPoints = [
{ dirs: ['link', 'http'] },
{ dirs: ['link', 'persisted-queries'] },
{ dirs: ['link', 'retry'] },
+ { dirs: ['link', 'remove-typename'] },
{ dirs: ['lin... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -206,6 +206,13 @@ Array [
]
`;
+exports[`exports of public entry points @apollo/client/link/remove-typename 1`... | Auto strip `__typename` does not correctly handle JSON scalars
### Issue Description
#10724 introduced the ability to automatically strip `__typename` fields from `variables` before a request is made to a server. While this works well for the majority of cases, the change is a bit over-eager as it will also strip `_... | After some internal discussion, I'm convinced we will not be able to ship this as an opt-out solution because we break backwards compatibility for anyone that relies upon `__typename` as part of a JSON scalar. `__typename` _is_ allowed when used as part of a JSON scalar and people may be using this solution as a workar... | 2023-05-10T03:06:20Z | 3.8 |
apollographql/apollo-client | 10,937 | apollographql__apollo-client-10937 | [
"10935"
] | f796ce1ac72f31a951a1d0f0b78d19dd039a6398 | diff --git a/src/cache/inmemory/inMemoryCache.ts b/src/cache/inmemory/inMemoryCache.ts
--- a/src/cache/inmemory/inMemoryCache.ts
+++ b/src/cache/inmemory/inMemoryCache.ts
@@ -17,6 +17,7 @@ import type {
import {
addTypenameToDocument,
isReference,
+ DocumentTransform,
} from '../../utilities';
import type {
... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -383,6 +383,7 @@ Array [
"Concast",
"DEV",
"DeepMerger",
+ "DocumentTransform",
"Observable",
"add... | Fix circular dependency with `DocumentTransform` import in `InMemoryCache`
### Issue Description
When testing out the first beta release, I tried to run `@apollo/client` in a CLI environment and it blows up trying to instantiate `InMemoryCache`. When logging the import, it appears everything from the `cache` module ... | 2023-05-31T16:05:19Z | 3.8 | |
apollographql/apollo-client | 10,809 | apollographql__apollo-client-10809 | [
"10676"
] | a8e555a9a9549ec8deea02901810c97c9ce19bcb | diff --git a/config/bundlesize.ts b/config/bundlesize.ts
--- a/config/bundlesize.ts
+++ b/config/bundlesize.ts
@@ -3,7 +3,7 @@ import { join } from "path";
import { gzipSync } from "zlib";
import bytes from "bytes";
-const gzipBundleByteLengthLimit = bytes("35.00KB");
+const gzipBundleByteLengthLimit = bytes("35.04... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -376,6 +376,8 @@ Array [
"compact",
"concatPagination",
"createFragmentMap",
+ "createFulfilledPromise",... | `refetch` and `fetchMore` do not work correctly with `startTransition`
### Issue Description
React allows users to show stale UI for a transition via its `startTransition` by detecting whether the state change suspends a component or not. If the component suspends with the update made within `startTransition`, we shou... | 2023-04-26T18:52:39Z | 3.8 | |
apollographql/apollo-client | 10,766 | apollographql__apollo-client-10766 | [
"10713"
] | 174ab97c92f2e681548cf6e509dae97ac423293b | diff --git a/src/react/hooks/useSuspenseQuery.ts b/src/react/hooks/useSuspenseQuery.ts
--- a/src/react/hooks/useSuspenseQuery.ts
+++ b/src/react/hooks/useSuspenseQuery.ts
@@ -13,13 +13,14 @@ import {
NetworkStatus,
FetchMoreQueryOptions,
} from '../../core';
-import { isNonEmptyArray } from '../../utilities';
+i... | diff --git a/src/react/hooks/__tests__/useSuspenseQuery.test.tsx b/src/react/hooks/__tests__/useSuspenseQuery.test.tsx
--- a/src/react/hooks/__tests__/useSuspenseQuery.test.tsx
+++ b/src/react/hooks/__tests__/useSuspenseQuery.test.tsx
@@ -13,6 +13,7 @@ import { ErrorBoundary } from 'react-error-boundary';
import { Gra... | Ensure more accurate `TData` TypeScript types for `useSuspenseQuery`
Currently `useSuspenseQuery` sets the returned `data` property to type `TData` (a generic). This works well with the default behavior since the hook will throw errors when encountered.
There are however a couple cases that will cause `data` to rema... | 2023-04-14T19:20:46Z | 3.8 | |
apollographql/apollo-client | 10,450 | apollographql__apollo-client-10450 | [
"10429"
] | ba29d4fc138da9f0c08545cf56acabde0e340470 | diff --git a/config/bundlesize.ts b/config/bundlesize.ts
--- a/config/bundlesize.ts
+++ b/config/bundlesize.ts
@@ -3,7 +3,7 @@ import { join } from "path";
import { gzipSync } from "zlib";
import bytes from "bytes";
-const gzipBundleByteLengthLimit = bytes("33.28KB");
+const gzipBundleByteLengthLimit = bytes("33.30... | diff --git a/src/react/hooks/__tests__/useSuspenseQuery.test.tsx b/src/react/hooks/__tests__/useSuspenseQuery.test.tsx
--- a/src/react/hooks/__tests__/useSuspenseQuery.test.tsx
+++ b/src/react/hooks/__tests__/useSuspenseQuery.test.tsx
@@ -20,9 +20,16 @@ import {
DocumentNode,
InMemoryCache,
Observable,
+ Oper... | Export `client` and `subscribeToMore` from `useSuspenseQuery`
As explained in the [PR](https://github.com/apollographql/apollo-client/pull/10323), my initial goal with the API surface area of `useSuspenseQuery` was to keep it small and add to it as we have feedback throughout the alpha release process.
While working... | 2023-01-18T18:28:09Z | 3.8 | |
apollographql/apollo-client | 10,368 | apollographql__apollo-client-10368 | [
"10272"
] | 52d5af26129bcec6bd51b45511b8349695219c47 | diff --git a/config/bundlesize.ts b/config/bundlesize.ts
--- a/config/bundlesize.ts
+++ b/config/bundlesize.ts
@@ -3,7 +3,7 @@ import { join } from "path";
import { gzipSync } from "zlib";
import bytes from "bytes";
-const gzipBundleByteLengthLimit = bytes("31.87KB");
+const gzipBundleByteLengthLimit = bytes("32KB"... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -369,6 +369,7 @@ Array [
"getFragmentDefinitions",
"getFragmentFromSelection",
"getFragmentQueryDocument"... | 🐛: Mutations with @defer only responds with the first part
> To clarify, this is happening from a non-federated AS4 instance, not router.
**Intended outcome:**
Using the `useMutation` hook with a mutation with `@defer` results in only the first chunk loading.
For example, given a server responding with:
``... | This will require some changes to `QueryManager` most likely, inside of the `markMutationResult` method.
@alessbell just to confirm, is there any change Apollo Router has to consider here or is this strictly on the client side? cc @abernix
@jpvajda I don't have a test case that works against the router yet, but I'm n... | 2022-12-14T18:40:10Z | 3.7 |
apollographql/apollo-client | 10,499 | apollographql__apollo-client-10499 | [
"10496"
] | 2408fd3fe7259ebf8bd5c90b67ec71ce4124180d | diff --git a/config/bundlesize.ts b/config/bundlesize.ts
--- a/config/bundlesize.ts
+++ b/config/bundlesize.ts
@@ -3,7 +3,7 @@ import { join } from "path";
import { gzipSync } from "zlib";
import bytes from "bytes";
-const gzipBundleByteLengthLimit = bytes("32.37KB");
+const gzipBundleByteLengthLimit = bytes("32.42... | diff --git a/src/react/hooks/__tests__/useLazyQuery.test.tsx b/src/react/hooks/__tests__/useLazyQuery.test.tsx
--- a/src/react/hooks/__tests__/useLazyQuery.test.tsx
+++ b/src/react/hooks/__tests__/useLazyQuery.test.tsx
@@ -439,6 +439,77 @@ describe('useLazyQuery Hook', () => {
});
});
+
+ it("changing querie... | useLazyQuery ignores changes to the query document
### Issue Description
Despite what the documentation for useLazyQuery appears to suggest. Updating the "Query" option inside the trigger of the lazyQuery does nothing.
i.e.
`const [fetchMyQuery] = useLazyQuery(QUERY_1)`
and later calling `fetchMyQuery({ query:... | Hey @laytong 👋
This looks related to #10198, just used in a slightly different way. Seeing as `useQuery` supports the ability to [swap queries](https://github.com/apollographql/apollo-client/blob/b4a4bd16a911a233de6ada47780c84512f885401/src/react/hooks/__tests__/useQuery.test.tsx#L775-L810), I see no reason this s... | 2023-02-01T15:35:13Z | 3.7 |
apollographql/apollo-client | 10,340 | apollographql__apollo-client-10340 | [
"7626",
"11041"
] | 98359ef3c717ee15be8c167422bed124a6a64c34 | diff --git a/.size-limit.cjs b/.size-limit.cjs
--- a/.size-limit.cjs
+++ b/.size-limit.cjs
@@ -1,16 +1,16 @@
const checks = [
{
path: "dist/apollo-client.min.cjs",
- limit: "36.64kb"
+ limit: "38056",
},
{
path: "dist/main.cjs",
- import: "{ ApolloClient, InMemoryCache, HttpLink }"
+ imp... | diff --git a/integration-tests/browser-esm/tests/playwright/jsdeliver-esm.test.ts b/integration-tests/browser-esm/tests/playwright/jsdeliver-esm.test.ts
new file mode 100644
--- /dev/null
+++ b/integration-tests/browser-esm/tests/playwright/jsdeliver-esm.test.ts
@@ -0,0 +1,10 @@
+import { expect } from "@playwright/tes... | ApolloProvider causing rerenders in consumers if ApolloProvider is rerendered even with the same client argument
<!--
Thanks for filing an issue on Apollo Client!
Please make sure that you include the following information to ensure that your issue is actionable.
If you don't follow the template, your issu... | Running into this issue as well on latest npm apollo 3.4.16
| 2022-12-08T19:10:19Z | 3.7 |
apollographql/apollo-client | 10,143 | apollographql__apollo-client-10143 | [
"10105"
] | 03c8fa48f07e8f0f2563eaac195e25f228740c59 | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -303,8 +303,15 @@ export class ObservableQuery<
// Compares newResult to the snapshot we took of this.lastResult when it was
// first received.
- public isDifferentFromL... | diff --git a/src/__tests__/local-state/general.ts b/src/__tests__/local-state/general.ts
--- a/src/__tests__/local-state/general.ts
+++ b/src/__tests__/local-state/general.ts
@@ -1,5 +1,16 @@
import gql from 'graphql-tag';
-import { DocumentNode, GraphQLError, getIntrospectionQuery } from 'graphql';
+import {
+ graph... | "Loading" stays true when the same result is returned twice in Apollo Client 3.6.9
This has been a long-standing issue that I've seen numerous people bring up, but I may have found the cause.
Here is the problem:
```js
const request = {
query: gql`
query test($foo: String) {
test(foo: $foo) {
... | Sorry to hear this is a problem @michaelcbrook - any chance you can provide a small runnable reproduction (repro [template](https://github.com/apollographql/react-apollo-error-template), repro [codesandbox](https://codesandbox.io/s/github/apollographql/react-apollo-error-template)) that demonstrates the problem? This w... | 2022-09-28T22:10:20Z | 3.7 |
apollographql/apollo-client | 10,134 | apollographql__apollo-client-10134 | [
"10116"
] | 14423c2a5a2c32426f235ccfd283f558e47a3b7b | diff --git a/src/react/hooks/useSubscription.ts b/src/react/hooks/useSubscription.ts
--- a/src/react/hooks/useSubscription.ts
+++ b/src/react/hooks/useSubscription.ts
@@ -2,6 +2,7 @@ import '../../utilities/globals';
import { useState, useRef, useEffect } from 'react';
import { DocumentNode } from 'graphql';
import ... | diff --git a/src/react/components/__tests__/client/Subscription.test.tsx b/src/react/components/__tests__/client/Subscription.test.tsx
--- a/src/react/components/__tests__/client/Subscription.test.tsx
+++ b/src/react/components/__tests__/client/Subscription.test.tsx
@@ -88,7 +88,37 @@ itAsync('executes the subscription... | change `onSubscriptionData` and `onSubscriptionComplete` to `onData` and `onComplete`
- relates to #9495
- see [comment](https://github.com/apollographql/apollo-client/pull/9495/files#r866194974)
As a follow up to #9495 we want to change `onSubscriptionData` and `onSubscriptionComplete` to `onData` and `onComplet... | @jpvajda I'd like to consider taking this on. Since `onSubscriptionData` and `onSubscriptionComplete` are currently in the stable API, I assume we'd want to deprecate these existing APIs (by showing a deprecation message) in addition to adding the new `onData` and `onComplete`.
Does this sound correct?
Should we ... | 2022-09-27T15:59:45Z | 3.7 |
apollographql/apollo-client | 9,808 | apollographql__apollo-client-9808 | [
"9804"
] | 83935e8e1ea2c3eb4a0f10fffbbfb4d51cfc02d2 | diff --git a/src/cache/inmemory/policies.ts b/src/cache/inmemory/policies.ts
--- a/src/cache/inmemory/policies.ts
+++ b/src/cache/inmemory/policies.ts
@@ -912,7 +912,7 @@ function makeFieldFunctionOptions(
canRead,
readField<T>() {
return policies.readField<T>(
- normalizeReadFieldOptions(argume... | diff --git a/src/cache/inmemory/__tests__/policies.ts b/src/cache/inmemory/__tests__/policies.ts
--- a/src/cache/inmemory/__tests__/policies.ts
+++ b/src/cache/inmemory/__tests__/policies.ts
@@ -1650,6 +1650,80 @@ describe("type policies", function () {
expect(cache.extract(true)).toEqual(expectedExtraction);
... | FieldFunctionOptions return incorrect variables
<!--
Thanks for filing an issue on Apollo Client!
Please make sure that you include the following information to ensure that your issue is actionable.
If you don't follow the template, your issue may end up being closed without anyone looking at it carefully,... | 2022-06-10T19:25:30Z | 3.6 | |
apollographql/apollo-client | 9,369 | apollographql__apollo-client-9369 | [
"8345"
] | 915f34d8056278c2ac6121e5e63f65193d01b45c | diff --git a/config/entryPoints.js b/config/entryPoints.js
--- a/config/entryPoints.js
+++ b/config/entryPoints.js
@@ -12,6 +12,7 @@ const entryPoints = [
{ dirs: ['link', 'persisted-queries'] },
{ dirs: ['link', 'retry'] },
{ dirs: ['link', 'schema'] },
+ { dirs: ['link', 'subscriptions'] },
{ dirs: ['lin... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -210,6 +210,12 @@ Array [
]
`;
+exports[`exports of public entry points @apollo/client/link/subscriptions 1`] ... | Why use WebSocketLink from '@apollo/client/link/ws'
1) Sorry for my english.
2) thanks for your time.
In your documentation (https://www.apollographql.com/docs/react/api/link/apollo-link-ws/) you encourage to use WebSocket which depends on subscriptions-transport-ws npm package. but apollographql/subscriptions-tra... | +1, I think it would be better to link to the new `graphql-ws` library which is being actively maintained.
To the maintainers: was there a particular reason for using `subscriptions-transport-ws` in the documentation example? If not, happy to work on getting the documentation updated for the replacement library
I tr... | 2022-01-28T20:35:32Z | 3.5 |
apollographql/apollo-client | 9,328 | apollographql__apollo-client-9328 | [
"9142"
] | a3e8ae0ccbc2fdd0cc087a8cd89221ca9eed1bca | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -326,7 +326,7 @@ export class ObservableQuery<
// (no-cache, network-only, or cache-and-network), override it with
// network-only to force the refetch for this fetchQu... | diff --git a/src/react/hooks/__tests__/useLazyQuery.test.tsx b/src/react/hooks/__tests__/useLazyQuery.test.tsx
--- a/src/react/hooks/__tests__/useLazyQuery.test.tsx
+++ b/src/react/hooks/__tests__/useLazyQuery.test.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { GraphQLError } from 'graphql';
import gql from... | useLazyQuery promise .catch not catching errors, when useMutation does
I should be able to add a `.catch` to the `useLazyQuery` promise, which should be called when the response is a graphql _or_ network error. Right now, the `.catch` does not fire in either case, and the error is present in the result variable inside ... | @MattBred Thanks for reporting this!
Seems like [this `Promise`](https://github.com/apollographql/apollo-client/blob/5d0c881a4c20c5c48842d9a8d246d26a917eccf9/src/react/hooks/useLazyQuery.ts#L44) needs to be rejected on errors, but we're currently only using its `resolve` function. Can you take a look @brainkim?
I ob... | 2022-01-19T20:51:08Z | 3.5 |
apollographql/apollo-client | 9,222 | apollographql__apollo-client-9222 | [
"8426"
] | 2e138aa88e7eda59fffd7424023ec633ef19814e | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -24,6 +24,7 @@ import {
FetchMoreQueryOptions,
SubscribeToMoreOptions,
WatchQueryFetchPolicy,
+ NextFetchPolicyContext,
} from './watchQueryOptions';
import { QueryIn... | diff --git a/src/__tests__/__snapshots__/exports.ts.snap b/src/__tests__/__snapshots__/exports.ts.snap
--- a/src/__tests__/__snapshots__/exports.ts.snap
+++ b/src/__tests__/__snapshots__/exports.ts.snap
@@ -16,7 +16,6 @@ Array [
"NetworkStatus",
"Observable",
"ObservableQuery",
- "applyNextFetchPolicy",
"c... | [v3.4 Regression] Changing variables uses nextFetchPolicy instead of fetchPolicy
**Intended outcome:**
I have a query with `fetchPolicy: 'network-only'` and `nextFetchPolicy: 'cache-first'`. When I change the variables, it should fetch new results from the server regardless of what's in the cache.
**Actual outcome:... | Related:
- https://github.com/apollographql/apollo-client/issues/7437
- https://github.com/apollographql/apollo-client/issues/7311
- https://github.com/apollographql/apollo-client/issues/6839
@brainkim I thought it was interesting that #7437 is happening in v3.3 whereas I only saw my issue in v3.4. I played around a... | 2021-12-20T20:41:54Z | 3.6 |
apollographql/apollo-client | 8,718 | apollographql__apollo-client-8718 | [
"8697"
] | f7bda84dbd3a80ef2b73c3ec3716ad48c41bbad6 | diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts
--- a/src/core/ObservableQuery.ts
+++ b/src/core/ObservableQuery.ts
@@ -207,21 +207,35 @@ export class ObservableQuery<
networkStatus,
} as ApolloQueryResult<TData>;
- // If this.options.query has @client(always: true) fields, we ca... | diff --git a/src/core/__tests__/ObservableQuery.ts b/src/core/__tests__/ObservableQuery.ts
--- a/src/core/__tests__/ObservableQuery.ts
+++ b/src/core/__tests__/ObservableQuery.ts
@@ -2027,7 +2027,7 @@ describe('ObservableQuery', () => {
});
expect(observable.getCurrentResult()).toEqual({
- ... | useQuery with fetchPolicy: network-only return cache data at first render when remount component
<!--
Thanks for filing an issue on Apollo Client!
Please make sure that you include the following information to ensure that your issue is actionable.
If you don't follow the template, your issue may end up bei... | Same here.
After upgrading from 3.3 to 3.4 this started happening. I checked that last 3.3.21 version worked as expected. Change behaviour started from 3.4.0 and still occurs in 3.4.9 release. | 2021-08-27T15:50:42Z | 3.4 |
apollographql/apollo-client | 8,574 | apollographql__apollo-client-8574 | [
"8571"
] | b8b831f8cd575afab1440b5afda9f40971893791 | diff --git a/src/react/data/QueryData.ts b/src/react/data/QueryData.ts
--- a/src/react/data/QueryData.ts
+++ b/src/react/data/QueryData.ts
@@ -101,11 +101,10 @@ export class QueryData<TData, TVariables> extends OperationData<
public afterExecute({ lazy = false }: { lazy?: boolean } = {}) {
this.isMounted = true... | diff --git a/src/react/hooks/__tests__/useQuery.test.tsx b/src/react/hooks/__tests__/useQuery.test.tsx
--- a/src/react/hooks/__tests__/useQuery.test.tsx
+++ b/src/react/hooks/__tests__/useQuery.test.tsx
@@ -376,6 +376,31 @@ describe('useQuery Hook', () => {
unmount();
expect(client.getObservableQueries().... | useQuery with {ssr: false} is not fetched on client-side
**Intended outcome:**
Invoking a `useQuery` with `{ssr: false}` skips the query on SSR but fetches it on client-side.
**Actual outcome:**
Invoking a `useQuery` with `{ssr: false}` does not fetch the query on client-side either. It returns `{data: undefined, ... | @hevele-moda Thanks for the reproduction!
This appears to be a regression introduced in `@apollo/client@3.4.0-rc.13`, possibly from commit 43d64356e656c42bd28523394e07c1c0584aa4b2. Does that sound plausible @brainkim? | 2021-08-02T20:16:41Z | 3.4 |
apollographql/apollo-client | 8,438 | apollographql__apollo-client-8438 | [
"8267"
] | f4bc1e0f114c4119fb0dfedfa8f9cd3922a8441b | diff --git a/src/utilities/policies/pagination.ts b/src/utilities/policies/pagination.ts
--- a/src/utilities/policies/pagination.ts
+++ b/src/utilities/policies/pagination.ts
@@ -98,20 +98,25 @@ export function relayStylePagination<TNode = Reference>(
if (!existing) return;
const edges: TRelayEdge<TNode... | diff --git a/src/cache/inmemory/__tests__/policies.ts b/src/cache/inmemory/__tests__/policies.ts
--- a/src/cache/inmemory/__tests__/policies.ts
+++ b/src/cache/inmemory/__tests__/policies.ts
@@ -3461,7 +3461,7 @@ describe("type policies", function () {
edges,
pageInfo: {
... | `relayStylePagination` `read` method clobbers `pageInfo.startCursor` and `pageInfo.endCursor`
**Intended outcome:**
With a query as follows:
```graphql
query {
someConnectionField {
edges {
node {
id
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
```
... | Having the same issue, can't use ```relayStylePagination()``` at all. Cursors are always empty.
So i just copied all implementation and replaced
https://github.com/apollographql/apollo-client/blob/54fe88a4dd7d3f0850f37a5dcf93c8404bf6e566/src/utilities/policies/pagination.ts#L101-L102
By
```javascript
let { startCur... | 2021-06-28T23:44:58Z | 3.3 |
apollographql/apollo-client | 8,394 | apollographql__apollo-client-8394 | [
"6886"
] | bfe0e75662d3fb7cbedb5dc17518c741eeeaafe3 | diff --git a/config/helpers.ts b/config/helpers.ts
--- a/config/helpers.ts
+++ b/config/helpers.ts
@@ -11,7 +11,7 @@ export function eachFile(dir: string, callback: (
) => any) {
const promises: Promise<any>[] = [];
- return new Promise((resolve, reject) => {
+ return new Promise<void>((resolve, reject) => {
... | diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts
--- a/src/__tests__/client.ts
+++ b/src/__tests__/client.ts
@@ -2582,8 +2582,9 @@ describe('client', () => {
const lastError = observable.getLastError();
const lastResult = observable.getLastResult();
- expect(lastResult.loading).... | chore(deps): update dependency typescript to v4
[](https://renovatebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [typescript](https://www.typescriptlang.org... | 2021-06-17T17:01:05Z | 3.4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.